]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include/buffer_raw: avoid using std::aligned_storage_t 64041/head
authorKefu Chai <tchaikov@gmail.com>
Thu, 19 Jun 2025 09:57:18 +0000 (17:57 +0800)
committerKefu Chai <tchaikov@gmail.com>
Thu, 19 Jun 2025 10:01:57 +0000 (18:01 +0800)
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>
src/include/buffer_raw.h

index 2298525c9599a3184791a9b83c9c102cbc2a1ea7..64225608806398e691495d1fbc5b5cdcc775ceb3 100644 (file)
@@ -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<sizeof(ptr_node),
-                        alignof(ptr_node)>::type bptr_storage;
+    struct alignas(ptr_node) {
+      unsigned char data[sizeof(ptr_node)];
+    } bptr_storage;
   protected:
     char *data;
     unsigned len;