Skip to content

Commit

Permalink
Fix use of std::remove_cv in static_assert (TartanLlama#90)
Browse files Browse the repository at this point in the history
Access result via the member type 'type'. Otherwise the static_assert does not
do as was intended.
  • Loading branch information
bobbleclank authored Sep 7, 2021
1 parent 68a5f5d commit 96d547c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/tl/expected.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit 96d547c

Please sign in to comment.