mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 12:19:12 +00:00
Common: replace std::aligned_storage_t with alignas
C++23 deprecates std::aligned_storage_t while alignas works since C++11. This fixes issue 12925.
This commit is contained in:
parent
99f98b2481
commit
59dfc43949
1 changed files with 1 additions and 1 deletions
|
@ -201,7 +201,7 @@ inline To BitCast(const From& source) noexcept
|
||||||
static_assert(std::is_trivially_copyable<To>(),
|
static_assert(std::is_trivially_copyable<To>(),
|
||||||
"BitCast destination type must be trivially copyable.");
|
"BitCast destination type must be trivially copyable.");
|
||||||
|
|
||||||
std::aligned_storage_t<sizeof(To), alignof(To)> storage;
|
alignas(To) std::byte storage[sizeof(To)];
|
||||||
std::memcpy(&storage, &source, sizeof(storage));
|
std::memcpy(&storage, &source, sizeof(storage));
|
||||||
return reinterpret_cast<To&>(storage);
|
return reinterpret_cast<To&>(storage);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue