diff options
Diffstat (limited to 'asl/meta.hpp')
-rw-r--r-- | asl/meta.hpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/asl/meta.hpp b/asl/meta.hpp index 43bd7cc..84616f4 100644 --- a/asl/meta.hpp +++ b/asl/meta.hpp @@ -190,7 +190,7 @@ template<> struct _is_integer_helper<uint64_t> : true_type {}; template<typename T> concept is_integer = _is_integer_helper<un_cv_t<T>>::value;
template<typename T, typename U>
-concept equality_comparable_with = requires (const un_cvref_t<T>& a, const un_cvref_t<T>& b)
+concept equality_comparable_with = requires (const un_cvref_t<T>& a, const un_cvref_t<U>& b)
{
{ a == b } -> same_as<bool>;
{ b == a } -> same_as<bool>;
@@ -200,16 +200,12 @@ concept equality_comparable_with = requires (const un_cvref_t<T>& a, const un_cv template<typename T> concept equality_comparable = equality_comparable_with<T, T>;
-struct niche {};
+struct niche_t {};
template<typename T>
-concept has_niche = constructible_from<T, niche> &&
- requires (const T& value, niche n)
- {
- { value == n } -> same_as<bool>;
- };
+concept has_niche = constructible_from<T, niche_t> && equality_comparable_with<T, niche_t>;
template<typename T>
-concept is_niche = same_as<un_cvref_t<T>, niche>;
+concept is_niche = same_as<un_cvref_t<T>, niche_t>;
} // namespace asl
|