From: Kefu Chai Date: Thu, 19 Jun 2025 09:57:18 +0000 (+0800) Subject: include/buffer_raw: avoid using std::aligned_storage_t X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=cb680641df3f005f09ac3cbd96bcb1637b70a193;p=ceph.git include/buffer_raw: 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/include/buffer_raw.h b/src/include/buffer_raw.h index 2298525c9599a..6422560880639 100644 --- a/src/include/buffer_raw.h +++ b/src/include/buffer_raw.h @@ -30,8 +30,9 @@ inline namespace v15_2_0 { public: // In the future we might want to have a slab allocator here with few // embedded slots. This would allow to avoid the "if" in dtor of ptr_node. - std::aligned_storage::type bptr_storage; + struct alignas(ptr_node) { + unsigned char data[sizeof(ptr_node)]; + } bptr_storage; protected: char *data; unsigned len;