Skip to content

Commit 4dfd8df

Browse files
committed
Add possible implementation of is type_trait
Currently implementation collides with `is template` I believe that we can have it working.
1 parent 30276a8 commit 4dfd8df

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

include/cpp2util.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,26 @@ constexpr auto is( T const& ) -> std::false_type {
10741074
return {};
10751075
}
10761076

1077+
/*
1078+
Possible implementation of `x is type_trait` scenario, currently collides
1079+
with `x is `template` but should be doable to make it work
1080+
1081+
// Type traits
1082+
1083+
template <template <typename> class C, typename X>
1084+
requires std::derived_from<C<std::remove_reference_t<X>>, std::true_type>
1085+
auto is(X&&) -> std::true_type {
1086+
std::cout << __PRETTY_FUNCTION__ << " " << __LINE__ << std::endl;
1087+
return {};
1088+
}
1089+
1090+
template <template <typename> class C, typename X>
1091+
requires std::derived_from<C<std::remove_reference_t<X>>, std::false_type>
1092+
auto is(X&&) -> std::false_type {
1093+
std::cout << __PRETTY_FUNCTION__ << " " << __LINE__ << std::endl;
1094+
return {};
1095+
}
1096+
*/
10771097

10781098
// Types
10791099
//

0 commit comments

Comments
 (0)