Why must a string be constructed at run-time? [duplicate]
问题 This question already has answers here : Is it possible to use std::string in a constexpr? (4 answers) Closed 4 years ago . Can C-Strings or std::string s be created as constexpr or must they be created at run-time? With gcc 4.9.2 I can do this: constexpr const char foo[] = "blee"; (Sadly the November 2013 Customer Technology Preview does not allow Visual Studio to support this: https://stackoverflow.com/a/29255013/2642059) But even with gcc 4.9.2 I cannot do this: constexpr const std::string