From: Kefu Chai Date: Sat, 26 Apr 2025 10:06:26 +0000 (+0800) Subject: common: avoid using std::aligned_storage_t X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=07ac4c3f8b718e1d220c9a871e4f80821c584ee0;p=ceph.git common: avoid using std::aligned_storage_t 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 --- diff --git a/src/common/containers.h b/src/common/containers.h index c0aa835445bb6..a908fb19e3aa6 100644 --- a/src/common/containers.h +++ b/src/common/containers.h @@ -56,8 +56,9 @@ namespace ceph::containers { template class tiny_vector { // NOTE: to avoid false sharing consider aligning to cache line - using storage_unit_t = \ - std::aligned_storage_t; + struct alignas(Value) storage_unit_t { + unsigned char data[sizeof(Value)]; + }; std::size_t _size = 0; storage_unit_t* const data = nullptr;