Hacker News new | ask | show | jobs
by Joker_vD 2080 days ago
There is so many ways to write this comparison that after a couple of times you really wish there were something in the standard library to help you so that you could write e.g.

    bool operator<=(version lhs, version rhs) {
        return std::tie(lhs.Major, lhs.Minor, lhs.Patch) <= std::tie(rhs.Major, rhs.Minor, rhs.Patch);
    }
Wait, there is! And Python has something like this too, even more laconic: you don't need to write "std::tie", naked parentheses are enough.