3 ms·
If your target audience is C, packing 3 values into one might even be the easiest to reason about, you get a single value that you can compare with the usual <
by dezgeg 6y ago
If your target audience is C, packing 3 values into one might even be the easiest to reason about, you get a single value that you can compare with the usual < and > etc. operators.
- dragontamer 6y agoAt some point, someone needs to point out the nonsense and just accept operator overloading... Or maybe writing a version_cmp function or similar.
- 0xbadcafebee 6y agoThe language already has an incredibly simple facility to compare version numbers (that GP mentions, but also there's macros), but you want to do it in a more complex way?
- mortehu 6y agoI don't understand your exact point, but the GNU C library ships with the strverscmp() and versionsort() functions, which do the same thing as `ls -v`.