4 ms·
> but that's beyond the current level of technology Is it? In Rust and other languages you would use trait bounds to restrict the input types to be comparable
by estebank 7y ago
> but that's beyond the current level of technology
Is it? In Rust and other languages you would use trait bounds to restrict the input types to be comparable with each other, which would make this a compile time error.
- Dylan16807 7y agoHow does that prevent you from accidentally making a.compare(b) and b.compare(a) inconsistent on some values? Making sure you can compare the types is already happening in the compiler, and doesn't find the bug.