5#ifndef INCLUDE_CPPGC_TYPE_TRAITS_H_
6#define INCLUDE_CPPGC_TYPE_TRAITS_H_
18template <
typename T,
typename WeaknessTag,
typename WriteBarrierPolicy,
19 typename CheckingPolicy>
21struct DijkstraWriteBarrierPolicy;
22struct NoWriteBarrierPolicy;
24class UntracedMemberTag;
33template <
typename T,
typename =
void>
38 std::declval<Visitor*>()))>> : std::true_type {
41template <
typename T,
typename =
void>
43 static_assert(
sizeof(T),
"T must be fully defined");
48 T, std::void_t<decltype(std::declval<T>().Trace(std::declval<Visitor*>()))>>
54 "Trace methods should be marked as const.");
60template <
typename T,
typename =
void>
62 static_assert(
sizeof(T),
"T must be fully defined");
68 typename std::remove_const_t<T>::IsGarbageCollectedMixinTypeMarker>>
70 static_assert(
sizeof(T),
"T must be fully defined");
73template <
typename T,
typename =
void>
75 static_assert(
sizeof(T),
"T must be fully defined");
81 std::void_t<typename std::remove_const_t<T>::IsGarbageCollectedTypeMarker>>
83 static_assert(
sizeof(T),
"T must be fully defined");
86template <typename T, bool = HasGarbageCollectedTypeMarker<T>::value,
89 static_assert(
sizeof(T),
"T must be fully defined");
94 static_assert(
sizeof(T),
"T must be fully defined");
97template <typename T, bool = HasGarbageCollectedTypeMarker<T>::value>
99 static_assert(
sizeof(T),
"T must be fully defined");
104 static_assert(
sizeof(T),
"T must be fully defined");
109 : std::integral_constant<bool, IsGarbageCollectedType<T>::value ||
110 IsGarbageCollectedMixinType<T>::value> {
111 static_assert(
sizeof(T),
"T must be fully defined");
114template <
typename T,
bool = (HasGarbageCollectedTypeMarker<T>::value &&
115 HasGarbageCollectedMixinTypeMarker<T>::value)>
117 static_assert(
sizeof(T),
"T must be fully defined");
122 static_assert(
sizeof(T),
"T must be fully defined");
125template <
typename BasicMemberCandidate,
typename WeaknessTag,
126 typename WriteBarrierPolicy>
129 template <
typename T,
typename CheckingPolicy>
130 static std::true_type SubclassCheck(
132 static std::false_type SubclassCheck(...);
136 decltype(SubclassCheck(std::declval<BasicMemberCandidate*>()))
::value;
164 template <
typename U,
size_t = sizeof(U)>
165 static std::true_type IsSizeOfKnown(U*);
166 static std::false_type IsSizeOfKnown(...);
170 decltype(IsSizeOfKnown(std::declval<T*>()))
::value;
constexpr bool IsTraceableV
constexpr bool IsGarbageCollectedTypeV
constexpr bool IsGarbageCollectedOrMixinTypeV
constexpr bool IsWeakMemberTypeV
constexpr bool IsCompleteV
constexpr bool IsGarbageCollectedMixinTypeV
constexpr bool IsGarbageCollectedWithMixinTypeV
constexpr bool IsUntracedMemberTypeV
constexpr bool IsMemberTypeV
static constexpr bool value
static constexpr bool value