Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
namespace MyNamespace {
int ilength;
}
 
namespace MyNamespace {
int iwidth;
}
 
void f() {
  MyNamespace::ilength = MyNamespace::iwidth = 12;
}

The standard library introduces the namespace std for standards-provided declarations such as std::stringstd::vector, and std::for_each. However, it is undefined behavior to introduce new declarations in namespace std except under special circumstances. The C++ Standard, [namespace.std], paragraphs 1 and 2 [ISO/IEC 14882-2014], states the following:

...