Do not use deprecated std::aligned_storage

More details at https://wg21.link/P1413R3
Relates https://github.com/userver-framework/userver/issues/620
This commit is contained in:
Antony Polukhin 2024-06-05 19:30:47 +03:00
parent b8f1065f7f
commit bd2116fb87

View File

@ -30,7 +30,7 @@ struct pull_coroutine< T >::control_block {
state_t state;
std::exception_ptr except;
bool bvalid;
typename std::aligned_storage< sizeof( T), alignof( T) >::type storage;
alignas(T) unsigned char storage[sizeof(T)];
static void destroy( control_block * cb) noexcept;
@ -71,7 +71,7 @@ struct pull_coroutine< T & >::control_block {
state_t state;
std::exception_ptr except;
bool bvalid;
typename std::aligned_storage< sizeof( holder), alignof( holder) >::type storage;
alignas(holder) unsigned char storage[sizeof(holder)];
static void destroy( control_block * cb) noexcept;