3 ms·
> My programming experience is that that these "mathy" objects are about the only unambiguous use case for operator overloading. Rust's ability for smart point
by kd5bjo 6y ago
> My programming experience is that that these "mathy" objects are about the only unambiguous use case for operator overloading.
Rust's ability for smart pointers to overload the dereference operator works pretty well, though there is still some potential for abuse.
Part of what makes it reasonable is the required function signature: It can only ever produce a reference to some other type, which rules out some of the crazier possibilities.