Здравствуйте, uzhas, Вы писали:
U>очень удобным в некоторых случаях является функция std::tie
Ещё удобнее было бы избавиться от копипасто-опасного кода — сделать что-то такое
struct S { A a; B b; C c; };
auto const S_fields = [](S const& obj) -> auto { return std::tie(obj.a, obj.b, obj.c); };
bool operator == (S const& lhs, S const& rhs) { return S_fields(lhs) == S_fields(rhs); }
bool operator < (S const& lhs, S const& rhs) { return S_fields(lhs) < S_fields(rhs); }
Компилируется
http://ideone.com/wV2FJ6