function2
function2 copied to clipboard
std::aligned_storage_t is deprecated in C++23
cppreference: https://en.cppreference.com/w/cpp/types/aligned_storage
It's being used here:
/// A union which makes the pointer to the heap object share the
/// same space with the internal capacity.
/// The storage type is distinguished by multiple versions of the
/// control and vtable.
template <typename Capacity, typename = void>
struct internal_capacity {
/// We extend the union through a technique similar to the tail object hack
typedef union {
/// Tag to access the structure in a type-safe way
data_accessor accessor_;
/// The internal capacity we use to allocate in-place
std::aligned_storage_t<Capacity::capacity, Capacity::alignment> capacity_;
} type;
};