5 #ifndef INCLUDE_CPPGC_TYPE_TRAITS_H_
6 #define INCLUDE_CPPGC_TYPE_TRAITS_H_
17 template <
typename... Ts>
21 template <
typename... Ts>
28 template <
typename T,
template <
typename...
V>
class U>
31 template <
typename... W>
32 static std::true_type SubclassCheck(U<W...>*);
33 static std::false_type SubclassCheck(...);
36 static constexpr
bool value =
37 decltype(SubclassCheck(std::declval<T*>()))::value;
42 template <
typename T,
typename =
void>
47 std::declval<Visitor*>()))>> : std::true_type {
50 template <
typename T,
typename =
void>
52 static_assert(
sizeof(T),
"T must be fully defined");
57 T,
void_t<decltype(std::declval<T>().Trace(std::declval<Visitor*>()))>>
63 "Trace methods should be marked as const.");
69 template <
typename T,
typename =
void>
71 static_assert(
sizeof(T),
"T must be fully defined");
77 void_t<typename std::remove_const_t<T>::IsGarbageCollectedMixinTypeMarker>>
79 static_assert(
sizeof(T),
"T must be fully defined");
82 template <
typename T,
typename =
void>
84 static_assert(
sizeof(T),
"T must be fully defined");
89 T,
void_t<typename std::remove_const_t<T>::IsGarbageCollectedTypeMarker>>
91 static_assert(
sizeof(T),
"T must be fully defined");
104 template <
typename T>
109 #endif // INCLUDE_CPPGC_TYPE_TRAITS_H_