]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common/static_ptr: avoid using std::aligned_storage_t 64040/head
authorKefu Chai <tchaikov@gmail.com>
Thu, 19 Jun 2025 09:50:15 +0000 (17:50 +0800)
committerKefu Chai <tchaikov@gmail.com>
Thu, 19 Jun 2025 09:53:04 +0000 (17:53 +0800)
commit73399b053fad107282bbf13616eaf5c3134822b5
treed52f8ac978fd1b9f2af21aeb3acb53133dbd18b4
parent0c95e42ecfe46e4d35777dbe0fb23cbc00804eb3
common/static_ptr: 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. because the size of `Base`
class is not always 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 its size.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/common/static_ptr.h