HEX
Server: nginx/1.18.0
System: Linux vcwordpress 5.15.0-174-generic #184-Ubuntu SMP Fri Mar 13 18:41:50 UTC 2026 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/include/node/cppgc/internal/conditional-stack-allocated.h
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef INCLUDE_CPPGC_INTERNAL_CONDITIONAL_STACK_ALLOCATED_H_
#define INCLUDE_CPPGC_INTERNAL_CONDITIONAL_STACK_ALLOCATED_H_

#include <type_traits>

#include "cppgc/macros.h"       // NOLINT(build/include_directory)
#include "cppgc/type-traits.h"  // NOLINT(build/include_directory)

namespace cppgc {
namespace internal {

// Base class that is marked as stack allocated if T is either marked as stack
// allocated or a traceable type.
template <typename T>
class ConditionalStackAllocatedBase;

template <typename T>
concept RequiresStackAllocated =
    !std::is_void_v<T> &&
    (cppgc::IsStackAllocatedType<T> || cppgc::internal::IsTraceableV<T> ||
     cppgc::IsGarbageCollectedOrMixinTypeV<T>);

template <typename T>
  requires(RequiresStackAllocated<T>)
class ConditionalStackAllocatedBase<T> {
 public:
  CPPGC_STACK_ALLOCATED();
};

template <typename T>
  requires(!RequiresStackAllocated<T>)
class ConditionalStackAllocatedBase<T> {};

}  // namespace internal
}  // namespace cppgc

#endif  // INCLUDE_CPPGC_INTERNAL_CONDITIONAL_STACK_ALLOCATED_H_