File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 160160 <ClInclude Include =" select.hpp" />
161161 <ClInclude Include =" string_manip.hpp" />
162162 <ClInclude Include =" times.hpp" />
163+ <ClInclude Include =" trait.hpp" />
163164 <ClInclude Include =" transform.hpp" />
164165 <ClInclude Include =" tuple.hpp" />
165166 <ClInclude Include =" tuple_inheritance.hpp" />
Original file line number Diff line number Diff line change 123123 <ClInclude Include =" times.hpp" >
124124 <Filter >Header Files</Filter >
125125 </ClInclude >
126+ <ClInclude Include =" trait.hpp" >
127+ <Filter >Header Files</Filter >
128+ </ClInclude >
126129 </ItemGroup >
127130 <ItemGroup >
128131 <ClCompile Include =" Main.cpp" >
Original file line number Diff line number Diff line change 1+ #pragma once
2+ // only works on Clang and MSVC, not GCC
3+
4+ namespace mlib
5+ {
6+ template <auto T>
7+ struct trait_module
8+ {
9+ constexpr auto operator ()(auto X) const
10+ {
11+ // we call our NTTP
12+ T (X);
13+ return true ;
14+ }
15+ };
16+
17+
18+ template <auto T, auto ... trait_modules>
19+ requires ((trait_modules(T), ...))
20+ struct trait
21+ {
22+ constexpr trait () {}
23+
24+ static constexpr auto value = true ;
25+ };
26+ } // namespace mlib
You can’t perform that action at this time.
0 commit comments