How to implement idiomatic operator overloading for values and references in Rust?

The great thing about Rust is that it’s open source. This means you can see how the authors of the language have solved a problem. The closest analogue is primitive integer types: macro_rules! add_impl { ($($t:ty)*) => ($( #[stable(feature = “rust1”, since = “1.0.0”)] impl Add for $t { type Output = $t; #[inline] fn … Read more