1
// s isn't declared before
std::string(s);
s = "Hellow world";

It compiles and works as if s was declared as usual at least on msvc and gcc (C++14).

Why is it so? Did not find explanation in standard. Does it contradicts the standard?

Jarod42
  • 203,559
  • 14
  • 181
  • 302

0 Answers0