5#ifndef INCLUDE_CPPGC_TYPE_TRAITS_H_
6#define INCLUDE_CPPGC_TYPE_TRAITS_H_
19template <
typename T,
typename WeaknessTag,
typename WriteBarrierPolicy,
20 typename CheckingPolicy,
typename StorageType>
22struct DijkstraWriteBarrierPolicy;
23struct NoWriteBarrierPolicy;
25class UntracedMemberTag;
34template <
typename T,
typename =
void>
39 std::declval<Visitor*>()))>> : std::true_type {
42template <
typename T,
typename =
void>
44 static_assert(
sizeof(T),
"T must be fully defined");
49 T, std::void_t<decltype(std::declval<T>().Trace(std::declval<Visitor*>()))>>
55 "Trace methods should be marked as const.");
61template <
typename T,
typename =
void>
63 static_assert(
sizeof(T),
"T must be fully defined");
69 typename std::remove_const_t<T>::IsGarbageCollectedMixinTypeMarker>>
71 static_assert(
sizeof(T),
"T must be fully defined");
74template <
typename T,
typename =
void>
76 static_assert(
sizeof(T),
"T must be fully defined");
82 std::void_t<typename std::remove_const_t<T>::IsGarbageCollectedTypeMarker>>
84 static_assert(
sizeof(T),
"T must be fully defined");
87template <typename T, bool = HasGarbageCollectedTypeMarker<T>::value,
90 static_assert(
sizeof(T),
"T must be fully defined");
95 static_assert(
sizeof(T),
"T must be fully defined");
98template <typename T, bool = HasGarbageCollectedTypeMarker<T>::value>
100 static_assert(
sizeof(T),
"T must be fully defined");
105 static_assert(
sizeof(T),
"T must be fully defined");
110 : std::integral_constant<bool, IsGarbageCollectedType<T>::value ||
111 IsGarbageCollectedMixinType<T>::value> {
112 static_assert(
sizeof(T),
"T must be fully defined");
115template <
typename T,
bool = (HasGarbageCollectedTypeMarker<T>::value &&
116 HasGarbageCollectedMixinTypeMarker<T>::value)>
118 static_assert(
sizeof(T),
"T must be fully defined");
123 static_assert(
sizeof(T),
"T must be fully defined");
126template <
typename BasicMemberCandidate,
typename WeaknessTag,
127 typename WriteBarrierPolicy>
130 template <
typename T,
typename CheckingPolicy,
typename StorageType>
131 static std::true_type SubclassCheck(
132 const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
134 static std::false_type SubclassCheck(...);
137 static constexpr bool value =
decltype(SubclassCheck(
138 std::declval<std::decay_t<BasicMemberCandidate>*>()))
::value;
166 template <
typename U,
size_t = sizeof(U)>
167 static std::true_type IsSizeOfKnown(U*);
168 static std::false_type IsSizeOfKnown(...);
172 decltype(IsSizeOfKnown(std::declval<T*>()))
::value;
175template <
typename T,
typename U>
177 std::is_same_v<std::decay_t<T>, std::decay_t<U>>;
179template <
typename B,
typename D>
181 std::is_base_of_v<std::decay_t<B>, std::decay_t<D>> &&
182 !IsDecayedSameV<B, D>;
187template <
typename T,
typename WeaknessTag,
typename WriteBarrierPolicy,
188 typename CheckingPolicy,
typename StorageType>
190 T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy, StorageType>> =
true;
262 IsMemberTypeV<T> || IsWeakMemberTypeV<T>;
constexpr bool IsStrictlyBaseOfV
Definition: type-traits.h:180
constexpr bool IsDecayedSameV
Definition: type-traits.h:176
constexpr bool IsAnyMemberTypeV
Definition: type-traits.h:185
constexpr bool IsTraceableV
Definition: type-traits.h:59
Definition: allocation.h:38
constexpr bool IsGarbageCollectedOrMixinTypeV
Definition: type-traits.h:215
constexpr bool IsMemberTypeV
Definition: type-traits.h:230
constexpr bool IsCompleteV
Definition: type-traits.h:255
constexpr bool IsWeakMemberTypeV
Definition: type-traits.h:242
constexpr bool IsGarbageCollectedTypeV
Definition: type-traits.h:207
constexpr bool IsWeakV
Definition: type-traits.h:249
constexpr bool IsMemberOrWeakMemberTypeV
Definition: type-traits.h:261
constexpr bool IsGarbageCollectedWithMixinTypeV
Definition: type-traits.h:223
constexpr bool IsUntracedMemberTypeV
Definition: type-traits.h:236
constexpr bool IsAnyMemberTypeV
Definition: type-traits.h:268
constexpr bool IsGarbageCollectedMixinTypeV
Definition: type-traits.h:199
Definition: pointer-policies.h:30
Definition: type-traits.h:62
Definition: type-traits.h:75
Definition: type-traits.h:164
static constexpr bool value
Definition: type-traits.h:171
Definition: type-traits.h:89
Definition: type-traits.h:111
Definition: type-traits.h:99
Definition: type-traits.h:117
Definition: type-traits.h:144
Definition: type-traits.h:128
static constexpr bool value
Definition: type-traits.h:137
Definition: type-traits.h:35
Definition: type-traits.h:43
Definition: type-traits.h:158
Definition: type-traits.h:151
Definition: type-traits.h:30
Definition: pointer-policies.h:108