Hacker News new | ask | show | jobs
by BenFrantzDale 1175 days ago
I assume it’s been around forever. https://en.cppreference.com/w/cpp/language/new (Placement-new is the thing you are talking about.) C++20 has `std::construct_at` which does the same thing but is usable at compile time (in a `constexpr` context) https://en.cppreference.com/w/cpp/memory/construct_at
1 comments

TIL about std::construct_at, thanks!

edit: not sure why they didn't just bless placement new with constexpr powers though.