3 ms·
Another example is std::mem::swap. In the world of affine type system which Rust uses, swap is a primitive on an equal footing with assignment (which is actuall
by sanxiyn 6y ago
Another example is std::mem::swap. In the world of affine type system which Rust uses, swap is a primitive on an equal footing with assignment (which is actually called move). So naturally, move was written <-, and swap was written <->.
But <-> weirded people out, and people complained why Rust has so many special and strange operators. So Rust developers made it look similar to a library function. But it still is a primitive: it is impossible to implement swap yourself in safe code.
The result is that people use swap much less than they should, either because they are not aware of it, or because they think it is a specialized library function for special cases. This is significant and large cost. But it is still less than cost of looking weird. All because people won't even try languages with <->. Alas.