5 #ifndef INCLUDE_CPPGC_TYPE_TRAITS_H_
6 #define INCLUDE_CPPGC_TYPE_TRAITS_H_
10 #include <type_traits>
17 template <
typename T,
typename WeaknessTag,
typename WriteBarrierPolicy,
18 typename CheckingPolicy>
22 class StrongMemberTag;
23 class UntracedMemberTag;
27 template <
typename... Ts>
31 template <
typename... Ts>
40 template <
typename T,
typename =
void>
45 std::declval<
Visitor*>()))>> : std::true_type {
48 template <
typename T,
typename =
void>
50 static_assert(
sizeof(T),
"T must be fully defined");
55 T, void_t<
decltype(std::declval<T>().Trace(std::declval<
Visitor*>()))>>
61 "Trace methods should be marked as const.");
67 template <
typename T,
typename =
void>
69 static_assert(
sizeof(T),
"T must be fully defined");
77 static_assert(
sizeof(T),
"T must be fully defined");
80 template <
typename T,
typename =
void>
82 static_assert(
sizeof(T),
"T must be fully defined");
89 static_assert(
sizeof(T),
"T must be fully defined");
95 static_assert(
sizeof(T),
"T must be fully defined");
100 static_assert(
sizeof(T),
"T must be fully defined");
105 static_assert(
sizeof(T),
"T must be fully defined");
108 template <
typename T>
110 static_assert(
sizeof(T),
"T must be fully defined");
113 template <
typename T>
117 static_assert(
sizeof(T),
"T must be fully defined");
123 static_assert(
sizeof(T),
"T must be fully defined");
126 template <
typename T>
128 static_assert(
sizeof(T),
"T must be fully defined");
131 template <
typename BasicMemberCandidate,
typename WeaknessTag,
132 typename WriteBarrierPolicy>
135 template <
typename T,
typename CheckingPolicy>
136 static std::true_type SubclassCheck(
137 BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy>*);
138 static std::false_type SubclassCheck(...);
142 decltype(SubclassCheck(std::declval<BasicMemberCandidate*>()))::value;
145 template <
typename T,
150 template <
typename T>
157 template <
typename T>
164 template <
typename T>
173 template <
typename T>
181 template <
typename T>
189 template <
typename T>
197 template <
typename T>
204 template <
typename T>
210 template <
typename T>
216 template <
typename T>
223 template <
typename T>