-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInitMembers.cpp
48 lines (38 loc) · 1.06 KB
/
InitMembers.cpp
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
/**
* \file InitMembers.cpp
* \brief
*/
#include <StdStream/StdStream.h>
#include <StdTest/StdTest.h>
#include <Stl.h>
//-------------------------------------------------------------------------------------------------
struct Foo
{
const int value {10};
explicit Foo() :
value(20)
{
std::cout << "Constructor: " << __FUNCTION__ << ", " << STD_TRACE_VAR(value) << std::endl;
}
};
//-------------------------------------------------------------------------------------------------
Foo foo()
{
std::cout << "Along: " << __FUNCTION__ << std::endl;
return Foo();
}
//-------------------------------------------------------------------------------------------------
int main(int, char **)
{
Foo foo;
std::cout << "Main: " << __FUNCTION__ << ", " << STD_TRACE_VAR(foo.value) << std::endl;
::foo();
return EXIT_SUCCESS;
}
//-------------------------------------------------------------------------------------------------
#if OUTPUT
Constructor: Foo, value: 20
Main: main, foo.value: 20
Along: foo
Constructor: Foo, value: 20
#endif