File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -843,6 +843,26 @@ template<typename T, typename U>
843843constexpr auto is ( std::optional<U> const & x ) -> bool
844844 { return !x.has_value (); }
845845
846+ template <auto value, typename T>
847+ constexpr auto is_impl ( std::optional<T> const & x ) -> bool {
848+ if ( x.has_value () )
849+ return cpp2::is<value>(x.value ());
850+ else
851+ return false ;
852+ }
853+
854+ template <auto value, typename T>
855+ constexpr auto is ( std::optional<T> const & x ) -> bool
856+ { return cpp2::is_impl<value>(x); }
857+
858+ template <cstring_wrapper value, typename T>
859+ constexpr auto is ( std::optional<T> const & x ) -> bool
860+ { return cpp2::is_impl<value>(x); }
861+
862+ template <double_wrapper value, typename T>
863+ constexpr auto is ( std::optional<T> const & x ) -> bool
864+ { return cpp2::is_impl<value>(x); }
865+
846866template <typename T, typename X>
847867 requires std::is_same_v<X,std::optional<T>>
848868constexpr auto as ( X const & x ) -> auto&&
You can’t perform that action at this time.
0 commit comments