mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-05 13:13:54 +00:00
Merge pull request #10737 from Tilka/alignas
Common: replace std::aligned_storage_t with alignas
This commit is contained in:
commit
82b0098c3b
@ -201,7 +201,7 @@ inline To BitCast(const From& source) noexcept
|
||||
static_assert(std::is_trivially_copyable<To>(),
|
||||
"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));
|
||||
return reinterpret_cast<To&>(storage);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user