File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -871,6 +871,26 @@ template<typename T, typename U>
871
871
constexpr auto is ( std::optional<U> const & x ) -> bool
872
872
{ return !x.has_value (); }
873
873
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
+
874
894
template <typename T, typename X>
875
895
requires std::is_same_v<X,std::optional<T>>
876
896
constexpr auto as ( X const & x ) -> auto&&
You can’t perform that action at this time.
0 commit comments