summaryrefslogtreecommitdiff
path: root/c++/core/id.h
blob: f23d2060b2318219d44d7107e7db1c4106d5fe9f (plain)
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
#pragma once

namespace saw {
template<typename T>
class id {
private:
		using type = uint64_t;

		type value_;
public:
		id(type val):
				value_{val}
		{}

		SAW_DEFAULT_COPY(id);
		SAW_DEFAULT_MOVE(id);

		bool operator==(const id<T>& rhs) const {
				return value_ == rhs.value_;
		}

		bool operator!=(const id<T>& rhs) const {
				return !(*this == rhs);
		}

		type get_value() const {
				return value_;
		}
};
}