Is the following code correct?
constexpr char s[] = "a, bb, ccc";
static const char * s1 = s;
char * s2 = const_cast<char *>(s1);
s2[5] = 'x';
my first idea was that 's' exists only at compile time and 's1' probably is some kind of a copy of 's', but probably it is not quite correct because line 2 does not compile without 'const':
static char * s1 = s;
The error with MSCV2017 is: 'initializing': cannot convert from 'const char [11]' to 'char [11]'.
so it is not clear what is the relation between 's' and 's1'? Do they reference the same string literal?
c++17tag is for the C++17 standard, not about MSVC2017 (that would be thevisual-studio-2017tag).