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
  • 190,553
  • 13
  • 166
  • 271

0 Answers0