]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
include/any.h: avoid using std::aligned_storage_t 63027/head
authorKefu Chai <tchaikov@gmail.com>
Tue, 29 Apr 2025 02:54:57 +0000 (10:54 +0800)
committerKefu Chai <tchaikov@gmail.com>
Tue, 29 Apr 2025 07:25:58 +0000 (15:25 +0800)
commit74644aa8847894baba9672b6073a6ddc25137056
treee0f4ecf91429e79eb9e58d8971bf761c5fd6ee45
parent379637eb42119112d7344da73472dd05863fa170
include/any.h: 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 we do not always
pass a power-of-2 number to `immobile_any`, while `alignas()` requires
an alignment of power of 2. so we use `std::bit_ceil()` to calculate
the minimum alignment greater or equal to the given number.

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