Warning, file /include/node/cppgc/internal/conditional-stack-allocated.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005 #ifndef INCLUDE_CPPGC_INTERNAL_CONDITIONAL_STACK_ALLOCATED_H_
0006 #define INCLUDE_CPPGC_INTERNAL_CONDITIONAL_STACK_ALLOCATED_H_
0007
0008 #include <type_traits>
0009
0010 #include "cppgc/macros.h" // NOLINT(build/include_directory)
0011 #include "cppgc/type-traits.h" // NOLINT(build/include_directory)
0012
0013 namespace cppgc {
0014 namespace internal {
0015
0016
0017
0018 template <typename T>
0019 class ConditionalStackAllocatedBase;
0020
0021 template <typename T>
0022 concept RequiresStackAllocated =
0023 !std::is_void_v<T> &&
0024 (cppgc::IsStackAllocatedType<T> || cppgc::internal::IsTraceableV<T> ||
0025 cppgc::IsGarbageCollectedOrMixinTypeV<T>);
0026
0027 template <typename T>
0028 requires(RequiresStackAllocated<T>)
0029 class ConditionalStackAllocatedBase<T> {
0030 public:
0031 CPPGC_STACK_ALLOCATED();
0032 };
0033
0034 template <typename T>
0035 requires(!RequiresStackAllocated<T>)
0036 class ConditionalStackAllocatedBase<T> {};
0037
0038 }
0039 }
0040
0041 #endif