Skip to content
Permalink
Browse files
Merge pull request #10737 from Tilka/alignas
Common: replace std::aligned_storage_t with alignas
  • Loading branch information
JosJuice committed Jun 13, 2022
2 parents 99f98b2 + 59dfc43 commit 82b0098
Showing 1 changed file with 1 addition and 1 deletion.
@@ -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);
}

0 comments on commit 82b0098

Please sign in to comment.