From: Kefu Chai Date: Sat, 26 Apr 2025 10:06:26 +0000 (+0800) Subject: common: avoid using std::aligned_storage_t X-Git-Tag: v21.0.0~256^2~824^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F62991%2Fhead;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 c0aa835445bb..a908fb19e3aa 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;