-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathe13.cpp
51 lines (38 loc) · 804 Bytes
/
e13.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
49
50
51
//
// Created by martin on 15-10-22.
//
#include <bits/stdc++.h>
#include "Tracer.hpp"
using namespace std;
Tracer global_tracer { "global tracer" };
struct Test
{
Tracer t { "Test tracker" };
Tracer *t_ptr { new Tracer("Test ptr tracker") };
virtual ~Test ()
{
delete t_ptr;
}
};
void f1 (const Tracer &t)
{
cout << "f1 running..." << endl;
}
void f2 (Tracer t)
{
cout << "f2 running..." << endl;
}
int main (int argc, char *argv[])
try
{
Tracer main_tracer { "main tracer" };
Test test;
f1(Tracer("f1 tracer"));
f2(Tracer("f2 tracer"));
return EXIT_SUCCESS;
}
catch (exception &e)
{
cerr << "Error: " << e.what() << endl;
return EXIT_FAILURE;
}