5 #ifndef INCLUDE_CPPGC_TYPE_TRAITS_H_
6 #define INCLUDE_CPPGC_TYPE_TRAITS_H_
11 #include <type_traits>
18 template <
typename T,
typename WeaknessTag,
typename WriteBarrierPolicy,
19 typename CheckingPolicy>
23 class StrongMemberTag;
24 class UntracedMemberTag;
28 template <
typename... Ts>
32 template <
typename... Ts>
41 template <
typename T,
typename =
void>
46 std::declval<
Visitor*>()))>> : std::true_type {
49 template <
typename T,
typename =
void>
51 static_assert(
sizeof(T),
"T must be fully defined");
56 T, void_t<
decltype(std::declval<T>().Trace(std::declval<
Visitor*>()))>>
62 "Trace methods should be marked as const.");
68 template <
typename T,
typename =
void>
70 static_assert(
sizeof(T),
"T must be fully defined");
78 static_assert(
sizeof(T),
"T must be fully defined");
81 template <
typename T,
typename =
void>
83 static_assert(
sizeof(T),
"T must be fully defined");
90 static_assert(
sizeof(T),
"T must be fully defined");
96 static_assert(
sizeof(T),
"T must be fully defined");
101 static_assert(
sizeof(T),
"T must be fully defined");
106 static_assert(
sizeof(T),
"T must be fully defined");
109 template <
typename T>
111 static_assert(
sizeof(T),
"T must be fully defined");
114 template <
typename T>
118 static_assert(
sizeof(T),
"T must be fully defined");
124 static_assert(
sizeof(T),
"T must be fully defined");
127 template <
typename T>
129 static_assert(
sizeof(T),
"T must be fully defined");
132 template <
typename BasicMemberCandidate,
typename WeaknessTag,
133 typename WriteBarrierPolicy>
136 template <
typename T,
typename CheckingPolicy>
137 static std::true_type SubclassCheck(
138 BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy>*);
139 static std::false_type SubclassCheck(...);
143 decltype(SubclassCheck(std::declval<BasicMemberCandidate*>()))::value;
146 template <
typename T,
151 template <
typename T>
158 template <
typename T>
165 template <
typename T>
168 template <
typename T>
171 template <
typename U, size_t =
sizeof(U)>
172 static std::true_type IsSizeOfKnown(U*);
173 static std::false_type IsSizeOfKnown(...);
177 decltype(IsSizeOfKnown(std::declval<T*>()))::value;
186 template <
typename T>
194 template <
typename T>
202 template <
typename T>
210 template <
typename T>
217 template <
typename T>
223 template <
typename T>
229 template <
typename T>
236 template <
typename T>
242 template <
typename T>