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 f4866cf commit 48dbcb3Copy full SHA for 48dbcb3
include/cpp2util.h
@@ -637,6 +637,25 @@ auto is( X const& x ) -> bool {
637
return false;
638
}
639
640
+template <typename F, typename X>
641
+struct lambda_wrapper {
642
+ F f;
643
+ X x;
644
+
645
+ constexpr lambda_wrapper(F f, X x)
646
+ : f{f}, x{x} {}
647
648
+ template <typename T>
649
+ auto operator()(T&& t) const {
650
+ return f(std::forward<T>(t), x);
651
+ }
652
+};
653
654
+template< lambda_wrapper value, typename X >
655
+auto is( X const& x ) -> bool {
656
+ return value(x);
657
+}
658
659
//-------------------------------------------------------------------------------------------------------------
660
// Built-in as (partial)
661
//
0 commit comments