[cppgc] Remove custom void_t, use std
Remove the pre-C++17 implementation of void_t, just use std::void_t now. R=omerkatz@chromium.org Bug: v8:12425 Change-Id: Iabf72f1540ddb4db666e5a74f169f73546241c1f Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571888 Reviewed-by: Omer Katz <omerkatz@chromium.org> Commit-Queue: Clemens Backes <clemensb@chromium.org> Cr-Commit-Position: refs/heads/main@{#79812}
This commit is contained in:
parent
cff2b5000a
commit
6806378ce4
@ -19,7 +19,8 @@ struct HasFinalizeGarbageCollectedObject : std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct HasFinalizeGarbageCollectedObject<
|
||||
T, void_t<decltype(std::declval<T>().FinalizeGarbageCollectedObject())>>
|
||||
T,
|
||||
std::void_t<decltype(std::declval<T>().FinalizeGarbageCollectedObject())>>
|
||||
: std::true_type {};
|
||||
|
||||
// The FinalizerTraitImpl specifies how to finalize objects.
|
||||
|
@ -24,14 +24,6 @@ class StrongMemberTag;
|
||||
class UntracedMemberTag;
|
||||
class WeakMemberTag;
|
||||
|
||||
// Pre-C++17 custom implementation of std::void_t.
|
||||
template <typename... Ts>
|
||||
struct make_void {
|
||||
typedef void type;
|
||||
};
|
||||
template <typename... Ts>
|
||||
using void_t = typename make_void<Ts...>::type;
|
||||
|
||||
// Not supposed to be specialized by the user.
|
||||
template <typename T>
|
||||
struct IsWeak : std::false_type {};
|
||||
@ -42,7 +34,7 @@ template <typename T, typename = void>
|
||||
struct IsTraceMethodConst : std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct IsTraceMethodConst<T, void_t<decltype(std::declval<const T>().Trace(
|
||||
struct IsTraceMethodConst<T, std::void_t<decltype(std::declval<const T>().Trace(
|
||||
std::declval<Visitor*>()))>> : std::true_type {
|
||||
};
|
||||
|
||||
@ -53,7 +45,7 @@ struct IsTraceable : std::false_type {
|
||||
|
||||
template <typename T>
|
||||
struct IsTraceable<
|
||||
T, void_t<decltype(std::declval<T>().Trace(std::declval<Visitor*>()))>>
|
||||
T, std::void_t<decltype(std::declval<T>().Trace(std::declval<Visitor*>()))>>
|
||||
: std::true_type {
|
||||
// All Trace methods should be marked as const. If an object of type
|
||||
// 'T' is traceable then any object of type 'const T' should also
|
||||
@ -72,8 +64,8 @@ struct HasGarbageCollectedMixinTypeMarker : std::false_type {
|
||||
|
||||
template <typename T>
|
||||
struct HasGarbageCollectedMixinTypeMarker<
|
||||
T,
|
||||
void_t<typename std::remove_const_t<T>::IsGarbageCollectedMixinTypeMarker>>
|
||||
T, std::void_t<
|
||||
typename std::remove_const_t<T>::IsGarbageCollectedMixinTypeMarker>>
|
||||
: std::true_type {
|
||||
static_assert(sizeof(T), "T must be fully defined");
|
||||
};
|
||||
@ -85,7 +77,8 @@ struct HasGarbageCollectedTypeMarker : std::false_type {
|
||||
|
||||
template <typename T>
|
||||
struct HasGarbageCollectedTypeMarker<
|
||||
T, void_t<typename std::remove_const_t<T>::IsGarbageCollectedTypeMarker>>
|
||||
T,
|
||||
std::void_t<typename std::remove_const_t<T>::IsGarbageCollectedTypeMarker>>
|
||||
: std::true_type {
|
||||
static_assert(sizeof(T), "T must be fully defined");
|
||||
};
|
||||
|
@ -142,8 +142,7 @@ struct PostConstructionCallbackTrait<
|
||||
|
||||
template <typename T>
|
||||
struct PostConstructionCallbackTrait<
|
||||
T,
|
||||
internal::void_t<typename T::MarkerForMixinWithPostConstructionCallback>> {
|
||||
T, std::void_t<typename T::MarkerForMixinWithPostConstructionCallback>> {
|
||||
// The parameter could just be T*.
|
||||
static void Call(
|
||||
internal::GCedWithMixinWithPostConstructionCallback* object) {
|
||||
|
Loading…
Reference in New Issue
Block a user