EHS
Link.h
Go to the documentation of this file.
1#pragma once
2
3namespace ehs
4{
6 template<typename T>
7 class Link
8 {
9 public:
12
14 {
15 delete child;
16 }
17
19 : value(), child(nullptr)
20 {
21 }
22
23 Link(const T value, Link* child)
25 {
26 }
27
28 Link(const T value)
29 : value(value), child(nullptr)
30 {
31 }
32
33 Link(const Link& link)
34 : value(link.value), child(nullptr)
35 {
36 }
37
38 Link(Link&& link) noexcept
39 : value(link.value), child(link.child)
40 {
41 link.value = 0;
42 link.child = nullptr;
43 }
44
45 Link& operator=(const Link& link)
46 {
47 if (this == &link)
48 return *this;
49
50 value = link.value;
51 child = nullptr;
52
53 return *this;
54 }
55
56 Link& operator=(Link&& link) noexcept
57 {
58 if (this == &link)
59 return *this;
60
61 value = link.value;
62 child = link.child;
63
64 link.value = 0;
65 link.child = nullptr;
66
67 return *this;
68 }
69 };
70}
Definition: Anchor.h:6