Fix use of std::remove_cv in static_assert (#90)

Access result via the member type 'type'. Otherwise the static_assert does not
do as was intended.
This commit is contained in:
bobble-clank
2021-09-07 19:23:16 +10:00
committed by GitHub
parent 68a5f5d701
commit 96d547c03d

View File

@@ -1216,11 +1216,11 @@ class expected : private detail::expected_move_assign_base<T, E>,
private detail::expected_delete_assign_base<T, E>,
private detail::expected_default_ctor_base<T, E> {
static_assert(!std::is_reference<T>::value, "T must not be a reference");
static_assert(!std::is_same<T, std::remove_cv<in_place_t>>::value,
static_assert(!std::is_same<T, std::remove_cv<in_place_t>::type>::value,
"T must not be in_place_t");
static_assert(!std::is_same<T, std::remove_cv<unexpect_t>>::value,
static_assert(!std::is_same<T, std::remove_cv<unexpect_t>::type>::value,
"T must not be unexpect_t");
static_assert(!std::is_same<T, std::remove_cv<unexpected<E>>>::value,
static_assert(!std::is_same<T, typename std::remove_cv<unexpected<E>>::type>::value,
"T must not be unexpected<E>");
static_assert(!std::is_reference<E>::value, "E must not be a reference");