std::aligned_storage_t was deprecated in C++23, to be prepared for it,
let's use alignas for the same behavior. because the 3 * 8 (with LP64
data model) is not power-of-2, while `alignas()` requires an alignment
of power of 2. so we use `std::bit_ceil()` to calculate the minimum
alignment greater or equal to this number.
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
#pragma once
+#include <bit>
#include <cstdint>
#include <memory>
-#include <type_traits>
#include <boost/intrusive/list.hpp>
#include "include/rados/librados_fwd.hpp"
uint64_t id = 0; // id allows caller to associate a result with its request
bufferlist data; // result buffer for reads
int result = 0;
- std::aligned_storage_t<3 * sizeof(void*)> user_data;
+ static constexpr size_t user_data_alignment = std::bit_ceil(3 * sizeof(void*));
+ struct alignas(user_data_alignment) {
+ unsigned char data[user_data_alignment];
+ } user_data;
AioResult() = default;
AioResult(const AioResult&) = delete;