C++20 constexpr vector string
1、在阅读 pabloariasal C++ - Initialization of Static Variables 时,其中提及了这个topic
2、modernescpp constexpr std::vector and std::string in C++20 中,对此进行了深入的分析
pabloariasal C++ - Initialization of Static Variables
The future looks bright, however. Even when moving slowly, smart people have been working on several proposals to augment the capabilities of constexpr
to types like std::string
or std::vector
. The idea here is to allow for memory allocations at compile time and later flash the object alongside its managed memory into the data section of the binary.