Padded alias
A T that occupies whole cache lines of its own.
- Use
import ThinkMeta.ConcurrentTasks.Cpp.Padded;- Namespace
ThinkMeta::ConcurrentTasks::Cpp
Syntax
template <typename T, std::size_t PadSize = CT_CACHE_LINE_SIZE>
using Padded =
std::conditional_t<
sizeof(T) % PadSize == 0,
_Padded0<T, PadSize>,
_Padded<T, PadSize>
>;Template parameters
Ttypename- The wrapped type: a class that can be derived from.
PadSizestd::size_t- Alignment and size granularity in bytes; a power of two, by default the cache line size.Default:
CT_CACHE_LINE_SIZE
Remarks
Also in arrays: aligned to PadSize and padded to a multiple of it. The padded object is a T and is constructed and used like one. T must be a class that can be derived from (not final). PadSize must be a power of two; default is the cache line size (CT_CACHE_LINE_SIZE).
Generated from ThinkMeta.ConcurrentTasks.API @ 137ec1d (2026-10-17).