Код: Выделить всё
struct old_class {
std::string a;
std::optional b;
std::optional c;
friend auto operator(const old_class&,
const old_class&) = default;
};
struct new_class {
std::string a;
std::optional b;
std::optional c;
int new_data_field_not_to_be_compared;
friend auto operator(const new_class& lhs,
const new_class& rhs) -> std::strong_ordering {
return (std::tie(lhs.a,rhs.a) std::tie(lhs.b,rhs.b)) std::tie(lhs.c,rhs.c);
}
};
Как исправить new_class :: operator ?
mre на coliru
Подробнее здесь: https://stackoverflow.com/questions/794 ... cific-memb