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 bc800ad commit 3fb4d2fCopy full SHA for 3fb4d2f
include/cpp2util.h
@@ -683,6 +683,19 @@ auto as(T&& t) -> auto
683
return cpp2::optional_as<C>(std::forward<T>(t));
684
}
685
686
+template< typename T >
687
+struct strict {
688
+ using type = T;
689
+};
690
+
691
+template< typename S, typename T >
692
+auto as(T&& t) -> auto
693
+ requires (is<cpp2::strict>(S{}))
694
+{
695
+ using C = typename S::type;
696
+ return cpp2::strict_as<C>(std::forward<T>(t));
697
+}
698
699
//-------------------------------------------------------------------------------------------------------------
700
// std::variant is and as
701
//
0 commit comments