File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -871,6 +871,26 @@ template<typename T, typename U>
871871constexpr auto is ( std::optional<U> const & x ) -> bool
872872 { return !x.has_value (); }
873873
874+ template <auto value, typename T>
875+ constexpr auto is_impl ( std::optional<T> const & x ) -> bool {
876+ if ( x.has_value () )
877+ return cpp2::is<value>(x.value ());
878+ else
879+ return false ;
880+ }
881+
882+ template <auto value, typename T>
883+ constexpr auto is ( std::optional<T> const & x ) -> bool
884+ { return cpp2::is_impl<value>(x); }
885+
886+ template <cstring_wrapper value, typename T>
887+ constexpr auto is ( std::optional<T> const & x ) -> bool
888+ { return cpp2::is_impl<value>(x); }
889+
890+ template <double_wrapper value, typename T>
891+ constexpr auto is ( std::optional<T> const & x ) -> bool
892+ { return cpp2::is_impl<value>(x); }
893+
874894template <typename T, typename X>
875895 requires std::is_same_v<X,std::optional<T>>
876896constexpr auto as ( X const & x ) -> auto&&
You can’t perform that action at this time.
0 commit comments