9#include <xpu/defines.h>
26 template<
typename T,
size_t N>
28 static_assert(N %
alignof(T) == 0,
"N must be a multiple of alignof(T)");
44 fValue = std::move(other.fValue);
63 XPU_D
operator T&() {
return fValue; }
64 XPU_D
operator const T&()
const {
return fValue; }
66 XPU_D
operator T*() {
return &
fValue; }
67 XPU_D
operator const T*()
const {
return &
fValue; }
A class that represents a value with padding to a certain size.
XPU_D PaddedValue(const PaddedValue &other)
XPU_D const T & operator*() const
XPU_D const T * operator->() const
XPU_D PaddedValue & operator=(const PaddedValue &other)
XPU_D T & operator=(const T &value)
unsigned char fPadding[N - sizeof(T)]
XPU_D PaddedValue()=default
XPU_D PaddedValue(PaddedValue &&other)
XPU_D const T & Get() const
XPU_D const T * operator&() const
XPU_D PaddedValue & operator=(PaddedValue &&other)
XPU_D PaddedValue(const T &value)
constexpr size_t SizeOfCacheLine