Is namespace std reserved?

Viewed 67

Suppose I have an outer namespace, and inside that namespace, I have an inner namespace std. Is this allowed or forbidden by the standard?

namespace outer {
    namespace std {
        // custom implementation
    }
}

I understand it’s probably considered poor practice or something, but I’m just trying to understand why C++ stl implementations always define _STD = ::std. Is it because someone theoretically could do using namespace outer::std? I’d figure that it would be forbidden by the standard.

More importantly, in my code, should I use ::std?

0 Answers
Related