diff --git a/include/beman/optional26/optional.hpp b/include/beman/optional26/optional.hpp index cca8806c..60baf418 100644 --- a/include/beman/optional26/optional.hpp +++ b/include/beman/optional26/optional.hpp @@ -276,29 +276,15 @@ class optional { template constexpr explicit(!std::is_convertible_v) optional(const optional& rhs) - requires(!std::is_reference_v && detail::enable_from_other && - std::is_convertible_v); - - template - constexpr explicit(!std::is_convertible_v) optional(const optional& rhs) - requires(!std::is_reference_v && detail::enable_from_other && - !std::is_convertible_v); + requires(!std::is_reference_v && detail::enable_from_other); template constexpr explicit(!std::is_convertible_v) optional(optional&& rhs) - requires(!std::is_reference_v && detail::enable_from_other && std::is_convertible_v); - - template - constexpr explicit(!std::is_convertible_v) optional(optional&& rhs) - requires(!std::is_reference_v && detail::enable_from_other && !std::is_convertible_v); - - template - constexpr explicit(!std::is_convertible_v) optional(const optional& rhs) - requires(detail::enable_from_other && std::is_convertible_v); + requires(!std::is_reference_v && detail::enable_from_other); template constexpr explicit(!std::is_convertible_v) optional(const optional& rhs) - requires(detail::enable_from_other && !std::is_convertible_v); + requires(detail::enable_from_other); // \ref{optional.dtor}, destructor constexpr ~optional() @@ -477,19 +463,7 @@ inline constexpr optional::optional(U&& u) template template inline constexpr optional::optional(const optional& rhs) - requires(!std::is_reference_v && detail::enable_from_other && - std::is_convertible_v) -{ - if (rhs.has_value()) { - construct(*rhs); - } -} - -template -template -inline constexpr optional::optional(const optional& rhs) - requires(!std::is_reference_v && detail::enable_from_other && - !std::is_convertible_v) + requires(!std::is_reference_v && detail::enable_from_other) { if (rhs.has_value()) { construct(*rhs); @@ -500,37 +474,17 @@ inline constexpr optional::optional(const optional& rhs) template template inline constexpr optional::optional(optional&& rhs) - requires(!std::is_reference_v && detail::enable_from_other && std::is_convertible_v) + requires(!std::is_reference_v && detail::enable_from_other) { if (rhs.has_value()) { construct(std::move(*rhs)); } } -template -template -inline constexpr optional::optional(optional&& rhs) - requires(!std::is_reference_v && detail::enable_from_other && !std::is_convertible_v) -{ - if (rhs.has_value()) { - construct(std::move(*rhs)); - } -} - -template -template -inline constexpr optional::optional(const optional& rhs) - requires(detail::enable_from_other && std::is_convertible_v) -{ - if (rhs.has_value()) { - construct(*rhs); - } -} - template template inline constexpr optional::optional(const optional& rhs) - requires(detail::enable_from_other && !std::is_convertible_v) + requires(detail::enable_from_other) { if (rhs.has_value()) { construct(*rhs);