aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/actors/util/named_tuple.h
blob: 67f185bba8b64d54e6a02a2c9e72d591b37fa0e5 (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();
    }
};