Editorial question53.8K views4,183 votes0 answers2,347 following
AI-generatedconstexpr new/delete: non‑trivial destructor support?
constexpr new/delete behavior The C++20 standard introduced constexpr new and constexpr delete to enable compile‑time dynamic allocation. The specification requires that objects allocated with constexpr new be trivially destructible, but it does not explicitly forbid non‑trivial destructors; instead, it leaves the behavior of constexpr delete ambiguous. Many