3 ms·
You can define multiple implementations for the Mul trait with different right-hand sides, no problem at all. https://play.rust-lang.org/?version=stable&mode=d
by yorwba 2y ago
You can define multiple implementations for the Mul trait with different right-hand sides, no problem at all.
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f4037fa7e0e0236fa1f226a585150d71 https://play.rust-lang.org/?version=stable&mode=debug&editio...
- fauigerzigerk 2y agoThanks, I didn't know that. In light of this, would you say that there is any sense in which Rust doesn't support the full extent of what is usually called operater overloading?
- lamontcg 2y agoI'm not who responded to you, but I think the important difference from some other languages is you can't define arbitrary operators, but there does seem to be Traits for overloading at least most of the built-in operators.