375.md
September 10, 2024 ยท View on GitHub
Example
static_assert([] {
std::array<int, 1024> storage{};
auto ptr = new (storage.data()) int{42};
return 42 == *ptr;
}());
static_assert([] {
std::array<int, 1024> storage{};
auto ptr = std::construct_at<int>(storage.data(), 42);
return 42 == *ptr;
}());