Using C ++ 11, Ubuntu 14.04, GCC default tool binding.
This code does not work:
constexpr std::string constString = "constString";
error: type 'const string {aka const std :: basic_string} of constexpr variable' constString is not a literal ... because ... 'Std :: basic_string has a nontrivial destructor
Is it possible to use std::string in constexpr ? (apparently no ...) If yes, then how? Is there an alternative way to use a character string in constexpr ?
stdstring c ++ 11 constexpr
Vector Nov 25. '14 at 9:44 2014-11-25 09:44
source share