Skip to content

Commit cb68064

Browse files
committed
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 <[email protected]>
1 parent 0c95e42 commit cb68064

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/include/buffer_raw.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ inline namespace v15_2_0 {
3030
public:
3131
// In the future we might want to have a slab allocator here with few
3232
// embedded slots. This would allow to avoid the "if" in dtor of ptr_node.
33-
std::aligned_storage<sizeof(ptr_node),
34-
alignof(ptr_node)>::type bptr_storage;
33+
struct alignas(ptr_node) {
34+
unsigned char data[sizeof(ptr_node)];
35+
} bptr_storage;
3536
protected:
3637
char *data;
3738
unsigned len;

0 commit comments

Comments
 (0)