pub trait RealRef<T>: RealByValue<T, T> + for<'a> RealByValue<&'a T, T> { }
Expand description

The trait to define &T op T and &T op &T versions for RealByValue based off the MIT/Apache 2.0 licensed code from num-traits 0.2.10:

This trait is not ever used directly for users of this library. You don’t need to deal with it unless implementing custom numeric types and even then it will be implemented automatically.

The trick is that all types implementing this trait will be references, so the first constraint expresses some &T which can be operated on with some right hand side type T to yield a value of type T.

In a similar way the second constraint expresses &T op &T -> T operations

Implementors

Anything which implements all the super traits will automatically implement this trait too. This covers primitives such as &f32 & &f64, ie a type like &f64 is RealRef<&f64> as well as Traces and Records of those types.