How can I constrain a type parameter N
in Rust such that it satisfies the requirement that usize
implements the Add
trait for N
(i.e. impl<N> std::ops::Add<N> for usize
)?
e.g.
fn foo<N /* usize: Add<N> */>(num: N) {
let _ = 2usize + num;
}