std::aligned_storage_t was deprecated in C++23, to be prepared for
it, let's use alignas for the same behavior.
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
template<typename Value, std::size_t InternalCapacity = 0>
class tiny_vector {
// NOTE: to avoid false sharing consider aligning to cache line
- using storage_unit_t = \
- std::aligned_storage_t<sizeof(Value), alignof(Value)>;
+ struct alignas(Value) storage_unit_t {
+ unsigned char data[sizeof(Value)];
+ };
std::size_t _size = 0;
storage_unit_t* const data = nullptr;