File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1662,14 +1662,16 @@ auto as( X && x ) -> decltype(auto) {
1662
1662
1663
1663
// std::optional variable is Type
1664
1664
//
1665
+ template <not_same_as<empty> T, specialization_of_template<std::optional> U>
1666
+ requires not_same_as<T, U> && not_same_as<T, pointee_t <U>>
1667
+ constexpr auto is ( U&& x ) -> std::false_type {
1668
+ return {};
1669
+ }
1670
+
1665
1671
template <not_same_as<empty> T, specialization_of_template<std::optional> U>
1666
1672
requires not_same_as<T, U>
1667
1673
constexpr auto is ( U&& x ) {
1668
- if constexpr (same_type_as<T, pointee_t <U>>) {
1669
- return std::true_type{};
1670
- } else {
1671
- return std::false_type{};
1672
- }
1674
+ return x.has_value ();
1673
1675
}
1674
1676
1675
1677
// -------------------------------------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments