class Version {↵
int major_, minor_, patch_;↵
public:↵
Version(int maj, int min, int pat) : major_(maj), minor_(min), patch_(pat) {}↵
↵
auto operator<=>(const Version& other) const = default;↵
↵
friend ostream& operator<<(ostream& os, const Version& v) {↵
return os << v.major_ << "." << v.minor_ << "." << v.patch_;↵
}↵
};↵
↵
Version v1(1, 2, 3), v2(1, 2, 4), v3(2, 0, 0);↵
↵
cout << v1 << " < " << v2 << ": " << (v1 < v2) << endl;↵
cout << v2 << " < " << v3 << ": " << (v2 < v3) << endl;↵
cout << v1 << " == " << v1 << ": " << (v1 == v1) << endl;