decorum icon indicating copy to clipboard operation
decorum copied to clipboard

Add implementations for std::ops traits that work on references

Open krtab opened this issue 5 years ago • 0 comments

For the Add trait, std has:

  • impl Add<f64> for f64
  • impl<'a> Add<f64> for &'a f64
  • impl<'_> Add<&'_ f64> for f64
  • impl<'_, '_> Add<&'_ f64> for &'_ f64

This PR adds the last three for ConstrainedFloat, for Add, Mul, Sub, Div, Rem.

It also add similar implementations for {Add,Mul,Sub,Div,Rem}Assign and Neg.

krtab avatar Jan 05 '21 15:01 krtab