blob: bd8e7c44b25d5830709dc1f53fbff99900ae1fe5 (
plain) (
blame)
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
#include "defs.h"
template <typename TDerived>
struct TNamedTupleBase {
friend bool operator==(const TDerived& x, const TDerived& y) {
return x.ConvertToTuple() == y.ConvertToTuple();
}
friend bool operator!=(const TDerived& x, const TDerived& y) {
return x.ConvertToTuple() != y.ConvertToTuple();
}
friend bool operator<(const TDerived& x, const TDerived& y) {
return x.ConvertToTuple() < y.ConvertToTuple();
}
friend bool operator<=(const TDerived& x, const TDerived& y) {
return x.ConvertToTuple() <= y.ConvertToTuple();
}
friend bool operator>(const TDerived& x, const TDerived& y) {
return x.ConvertToTuple() > y.ConvertToTuple();
}
friend bool operator>=(const TDerived& x, const TDerived& y) {
return x.ConvertToTuple() >= y.ConvertToTuple();
}
};
|