47template <
typename T, std::
size_t MinimumAlignment = cache_line>
80 template <
typename... Args>
86 ::new (
storage_.data()) T(std::forward<Args>(args)...);
120 [[nodiscard]]
auto get_ref() const noexcept -> const T& {
136 return std::launder(
reinterpret_cast<T*
>(
storage_.data()));
151 return std::launder(
reinterpret_cast<const T*
>(
storage_.data()));
Definition of cache_line variable.
Class of storage of objects.
auto get_ref() const noexcept -> const T &
Get the reference of the value.
auto get_pointer() noexcept -> T *
Get the pointer of the value.
std::array< char, sizeof(T)> storage_
Storage.
bool has_object_
Whether this storage has an object. (Defined only in debug build for debugging.)
auto get_ref() noexcept -> T &
Get the reference of the value.
void emplace(Args &&... args)
Construct an object.
void reset() noexcept
Destruct the object.
object_storage() noexcept=default
Constructor.
auto get_pointer() const noexcept -> const T *
Get the pointer of the value.