[C++] nested namespace definition
Updated:
개요
- 중첩된 네임스페이스 대한 정의
예제
- 코드
#include <iostream> using namespace std; // before C++17 namespace A { namespace B { namespace C { void func1() { cout << "func1() call" << endl; } } // namespace C } // namespace B } // namespace A // C++17 namespace A::B::C { void func2() { cout << "func2() call" << endl; } } // namespace A::B::C int main() { A::B::C::func1(); A::B::C::func2(); return 0; }
- 실행 결과
func1() call func2() call