summaryrefslogtreecommitdiff
path: root/asl/types/option.hpp
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2025-03-12 00:08:18 +0100
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2025-03-12 00:08:18 +0100
commitc8b73031d8a9f7770410c9d0e6da5b230e501e85 (patch)
treed458e28d72da3d343446fc8a6a6d92b3776c560a /asl/types/option.hpp
parentaf4e29f8c071b089fb46b5d8b964dd2b1fb3f57a (diff)
Remove convertible_from
Diffstat (limited to 'asl/types/option.hpp')
-rw-r--r--asl/types/option.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/asl/types/option.hpp b/asl/types/option.hpp
index 9c317b0..982c63d 100644
--- a/asl/types/option.hpp
+++ b/asl/types/option.hpp
@@ -110,7 +110,7 @@ public:
constexpr option(nullopt_t) requires kHasNiche : m_payload{in_place, niche_t{}} {}
template<typename U = T>
- constexpr explicit (!convertible_from<T, U&&>)
+ constexpr explicit (!convertible_to<U&&, T>)
option(U&& value)
requires (
kHasNiche &&
@@ -121,7 +121,7 @@ public:
{}
template<typename U = T>
- constexpr explicit (!convertible_from<T, U&&>)
+ constexpr explicit (!convertible_to<U&&, T>)
option(U&& value)
requires (
!kHasNiche &&
@@ -159,7 +159,7 @@ public:
}
template<typename U>
- constexpr explicit (!convertible_from<T, const U&>)
+ constexpr explicit (!convertible_to<const U&, T>)
option(const option<U>& other)
requires (
constructible_from<T, const U&> &&
@@ -174,7 +174,7 @@ public:
}
template<typename U>
- constexpr explicit (!convertible_from<T, U&&>)
+ constexpr explicit (!convertible_to<U&&, T>)
option(option<U>&& other)
requires (
constructible_from<T, U&&> &&
@@ -377,14 +377,14 @@ public:
template<typename U>
constexpr T value_or(U&& other_value) const&
- requires copy_constructible<T> && convertible_from<T, U&&>
+ requires copy_constructible<T> && convertible_to<U&&, T>
{
return has_value() ? value() : static_cast<T>(std::forward<U>(other_value));
}
template<typename U>
constexpr T value_or(U&& other_value) &&
- requires move_constructible<T> && convertible_from<T, U&&>
+ requires move_constructible<T> && convertible_to<U&&, T>
{
return has_value() ? std::move(value()) : static_cast<T>(std::forward<U>(other_value));
}