File tree 1 file changed +10
-13
lines changed
1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -1659,6 +1659,16 @@ auto is( X const& x ) -> bool {
1659
1659
{
1660
1660
return x == X ();
1661
1661
}
1662
+ else if constexpr (
1663
+ specialization_of_template<X, std::optional>
1664
+ )
1665
+ {
1666
+ if (x.has_value ()) {
1667
+ return is<C>(x.value ());
1668
+ } else {
1669
+ return std::is_same_v<C, empty>;
1670
+ }
1671
+ }
1662
1672
else {
1663
1673
return false ;
1664
1674
}
@@ -2135,19 +2145,6 @@ constexpr auto as( X const& x ) -> T
2135
2145
// std::optional is and as
2136
2146
//
2137
2147
2138
- // is Type
2139
- //
2140
- template <typename T, typename X>
2141
- requires std::is_same_v<X,std::optional<T>>
2142
- constexpr auto is ( X const & x ) -> bool
2143
- { return x.has_value (); }
2144
-
2145
- template <typename T, typename U>
2146
- requires std::is_same_v<T,empty>
2147
- constexpr auto is ( std::optional<U> const & x ) -> bool
2148
- { return !x.has_value (); }
2149
-
2150
-
2151
2148
// is Value
2152
2149
//
2153
2150
template <typename T>
You can’t perform that action at this time.
0 commit comments