0992デフォルトの名無しさん (ワッチョイ cb45-9/J3)
2021/05/08(土) 09:21:32.08ID:St3wXYGV0struct fix
{
int minor, major;
friend auto operator <=> (const fix& lhs, const fix& rhs) = default;
};
int main()
{
fix a{1, 2};
fix b{2, 1};
cout << boolalpha;
cout << (a < b) << endl; //true
cout << (a > b) << endl; //false
}
俺はまだ大小関係を定義してないのに勝手に何かぬかしてるようなんだけど
= default; が邪魔で定義できない
どうすればいい?