-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConstructingDebug.h
More file actions
47 lines (36 loc) · 975 Bytes
/
ConstructingDebug.h
File metadata and controls
47 lines (36 loc) · 975 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
//
// Created by alex on 18.03.2022.
//
#ifndef SPHERES_CONSTRUCTINGDEBUG_H
#define SPHERES_CONSTRUCTINGDEBUG_H
#include <iostream>
class ConstructingDebug
{
public:
ConstructingDebug()
{
std::cout << "ConstructingDebug: constructor" << std::endl;
value = -1;
}
explicit ConstructingDebug(int _value)
{
value = _value;
std::cout << "ConstructingDebug: constructor with parameter " << value << std::endl;
}
ConstructingDebug(const ConstructingDebug& other)
{
value = other.value;
std::cout << "ConstructingDebug: constructor copy " << value << std::endl;
}
ConstructingDebug(ConstructingDebug&& other) noexcept
{
value = other.value;
other.value = 0;
std::cout << "ConstructingDebug: constructor move " << value << std::endl;
}
ConstructingDebug& operator= (const ConstructingDebug& other) = delete;
ConstructingDebug& operator= (ConstructingDebug&& other) = delete;
private:
int value;
};
#endif //SPHERES_CONSTRUCTINGDEBUG_H