File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -808,6 +808,26 @@ template<typename T, typename U>
808
808
constexpr auto is ( std::optional<U> const & x ) -> bool
809
809
{ return !x.has_value (); }
810
810
811
+ template <auto value, typename T>
812
+ constexpr auto is_impl ( std::optional<T> const & x ) -> bool {
813
+ if ( x.has_value () )
814
+ return cpp2::is<value>(x.value ());
815
+ else
816
+ return false ;
817
+ }
818
+
819
+ template <auto value, typename T>
820
+ constexpr auto is ( std::optional<T> const & x ) -> bool
821
+ { return cpp2::is_impl<value>(x); }
822
+
823
+ template <cstring_wrapper value, typename T>
824
+ constexpr auto is ( std::optional<T> const & x ) -> bool
825
+ { return cpp2::is_impl<value>(x); }
826
+
827
+ template <double_wrapper value, typename T>
828
+ constexpr auto is ( std::optional<T> const & x ) -> bool
829
+ { return cpp2::is_impl<value>(x); }
830
+
811
831
template <typename T, typename X>
812
832
requires std::is_same_v<X,std::optional<T>>
813
833
constexpr auto as ( X const & x ) -> auto&&
You can’t perform that action at this time.
0 commit comments