summaryrefslogtreecommitdiff
path: root/asl/meta.hpp
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2025-01-05 15:25:45 +0100
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2025-01-05 15:25:45 +0100
commit8607772d4f9e21f53c1abfd9379737403b97f430 (patch)
treefcd5a5030bb1cc0ba4dd4069a0d7174a67791c03 /asl/meta.hpp
parentb53fc9038f4579974c9eea28e82b693a7fd66522 (diff)
Fix a few mistakes in option, and make it trivial when possible
Diffstat (limited to 'asl/meta.hpp')
-rw-r--r--asl/meta.hpp12
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