Skip to content

Commit 3e1282e

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 41ac6fd commit 3e1282e

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
@@ -1105,6 +1105,26 @@ constexpr auto is( T const& ) -> std::false_type {
11051105
return {};
11061106
}
11071107

1108+
/*
1109+
Possible implementation of `x is type_trait` scenario, currently collides
1110+
with `x is `template` but should be doable to make it work
1111+
1112+
// Type traits
1113+
1114+
template <template <typename> class C, typename X>
1115+
requires std::derived_from<C<std::remove_reference_t<X>>, std::true_type>
1116+
auto is(X&&) -> std::true_type {
1117+
std::cout << __PRETTY_FUNCTION__ << " " << __LINE__ << std::endl;
1118+
return {};
1119+
}
1120+
1121+
template <template <typename> class C, typename X>
1122+
requires std::derived_from<C<std::remove_reference_t<X>>, std::false_type>
1123+
auto is(X&&) -> std::false_type {
1124+
std::cout << __PRETTY_FUNCTION__ << " " << __LINE__ << std::endl;
1125+
return {};
1126+
}
1127+
*/
11081128

11091129
// Types
11101130
//

0 commit comments

Comments
 (0)