summaryrefslogtreecommitdiffstats
path: root/src/type-info.cpp
blob: dac61e786b2a9f0376627acc303ef11db9b01159 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "type-info.h"


TypeInfo::TypeInfo(const std::type_info& type_info) : type_info(&type_info) {
}

TypeInfo::TypeInfo(const TypeInfo& tinfo) : type_info(tinfo.type_info) {
}

TypeInfo& TypeInfo::operator=(const TypeInfo& rhs) {
	this->type_info = rhs.type_info;
	return *this;
}

bool TypeInfo::before(const TypeInfo& tinfo) const {
	return this->type_info->before(*tinfo.type_info);
}

const char* TypeInfo::name() const {
	return this->type_info->name();
}

const std::type_info& TypeInfo::get() const {
	return *this->type_info;
}

bool operator==(const TypeInfo& lhs, const TypeInfo& rhs) {
	return lhs.get() == rhs.get();
}

bool operator!=(const TypeInfo& lhs, const TypeInfo& rhs) {
	return !(lhs == rhs);
}

bool operator<(const TypeInfo& lhs, const TypeInfo& rhs) {
	return lhs.before(rhs);
}

bool operator<=(const TypeInfo& lhs, const TypeInfo& rhs) {
	return !(lhs > rhs);
}

bool operator>(const TypeInfo& lhs, const TypeInfo& rhs) {
	return rhs < lhs;
}

bool operator>=(const TypeInfo& lhs, const TypeInfo& rhs) {
	return !(lhs < rhs);
}