-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNestedNamespaces.cpp
More file actions
49 lines (37 loc) · 859 Bytes
/
NestedNamespaces.cpp
File metadata and controls
49 lines (37 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* \file NestedNamespaces.cpp
* \brief Nested namespaces
*
* Using the namespace resolution operator to create nested namespace definitions.
*/
#include <StdStream/StdStream.h>
#include <StdTest/StdTest.h>
#include <Stl.h>
//-------------------------------------------------------------------------------------------------
namespace A
{
namespace B
{
namespace C
{
int i {11};
}
}
}
// vs.
namespace A::B::C
{
int j {17};
}
//-------------------------------------------------------------------------------------------------
int main(int, char **)
{
std::cout << STD_TRACE_VAR(A::B::C::i) << std::endl;
std::cout << STD_TRACE_VAR(A::B::C::j) << std::endl;
return EXIT_SUCCESS;
}
//-------------------------------------------------------------------------------------------------
#if OUTPUT
A::B::C::i: 11
A::B::C::j: 17
#endif