How will C++20 constexpr containers work?
问题 As constexpr std::string and constexpr std::vector have been accepted into C++20, how will these be used? The linked papers are very short on details. Do we need to specify special constexpr allocators, making compile-time strings/vectors incompatible with their normal equivalents? 回答1: Those two papers depend heavily on P0784, which discusses how allocations at compile-time will work. Incomplete answer: Only std::allocator will work. All allocations are tracked, and must be deallocated