Loading...
Searching...
No Matches
IsTemplate.hpp
1#pragma once
2#include <cinttypes>
3#include <type_traits>
4
5// Check
6// https://stackoverflow.com/questions/39812789/is-there-any-way-of-detecting-arbitrary-template-classes-that-mix-types-and-non
7// again with c++20
8template <class T>
9struct is_template : std::false_type
10{
11};
12
13template <template <class...> class T, class... Args>
14struct is_template<T<Args...>> : std::true_type
15{
16};
17
18template <template <auto...> class T, auto... Args>
19struct is_template<T<Args...>> : std::true_type
20{
21};
22
23template <template <class, auto, auto...> class T, class Arg1, auto Arg2, auto... Arg3>
24 requires(sizeof...(Arg3) > 0)
25struct is_template<T<Arg1, Arg2, Arg3...>> : std::true_type
26{
27};
28template <template <auto, class, class...> class T, auto Arg1, class Arg2, class... Arg3>
29 requires(sizeof...(Arg3) > 0)
30struct is_template<T<Arg1, Arg2, Arg3...>> : std::true_type
31{
32};
33
34template <template <class, auto, class> class T, class Arg1, auto Arg2, class Arg3>
35struct is_template<T<Arg1, Arg2, Arg3>> : std::true_type
36{
37};
38
39template <
40 template <class, auto, class, class> class T, class Arg1, auto Arg2, class Arg3,
41 class Arg4>
42struct is_template<T<Arg1, Arg2, Arg3, Arg4>> : std::true_type
43{
44};
45
46template <
47 template <class, auto, class, class, class> class T, class Arg1, auto Arg2,
48 class Arg3, class Arg4, class Arg5>
49struct is_template<T<Arg1, Arg2, Arg3, Arg4, Arg5>> : std::true_type
50{
51};
52template <template <auto, class, auto> class T, auto Arg1, class Arg2, auto Arg3>
53struct is_template<T<Arg1, Arg2, Arg3>> : std::true_type
54{
55};
56
57template <
58 template <class, class, class, class, auto, auto, class> class T, class A1, class A2,
59 class A3, class A4, auto A5, auto A6, class A7>
60struct is_template<T<A1, A2, A3, A4, A5, A6, A7>> : std::true_type
61{
62};
63
64template <
65 template <class, class, class, class, class, auto, auto, class> class T, class A1,
66 class A2, class A3, class A4, class A5, auto A6, auto A7, class A8>
67struct is_template<T<A1, A2, A3, A4, A5, A6, A7, A8>> : std::true_type
68{
69};
70
71template <template <class, auto> class T, class X, auto u>
72struct is_template<T<X, u>> : std::true_type
73{
74};
75
76template <template <class, class, bool> class T, class A, class B, bool C>
77struct is_template<T<A, B, C>> : std::true_type
78{
79};
80
81template <
82 template <class, class, class, class, class, class, bool> class T, class A1,
83 class A2, class A3, class A4, class A5, class A6, bool B>
84struct is_template<T<A1, A2, A3, A4, A5, A6, B>> : std::true_type
85{
86};
87
88template <
89 template <class, class, class, class, class, class, class, bool> class T, class A1,
90 class A2, class A3, class A4, class A5, class A6, class A7, bool B>
91struct is_template<T<A1, A2, A3, A4, A5, A6, A7, B>> : std::true_type
92{
93};
94
95template <class>
96struct is_custom_serialized : std::false_type
97{
98};
STL namespace.