We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d6e7d0 commit 2f5d328Copy full SHA for 2f5d328
include/cpp2util.h
@@ -675,6 +675,17 @@ auto optional_as(T&& t) -> auto {
675
}
676
677
678
+template< typename O, typename T >
679
+auto as(T&& t) -> auto
680
+ requires (
681
+ requires {O::value_type;}
682
+ && std::is_same_v<std::optional<typename O::value_type>,O>
683
+ )
684
+{
685
+ using C = typename O::value_type;
686
+ return cpp2::optional_as<C>(std::forward<T>(t));
687
+}
688
+
689
//-------------------------------------------------------------------------------------------------------------
690
// std::variant is and as
691
//
0 commit comments