pub fn usize_plus_i<T>(u: usize, i: T) -> usizeExpand description
Adds generic type to usize. Can panic if the values are outside the range of the given types.
use aoclib_rs::usize_plus_i;
let i: i64 = 23;
assert_eq!(usize_plus_i(5, i), 28);
let i: i64 = -2;
assert_eq!(usize_plus_i(5, i), 3);
// let i: i64 = -8;
// usize_plus_i(5, i);
// panics: -3 is an invalid usize
// let i: i8 = 5;
// usize_plus_i(12345, i);
// panics: 12345 is an invalid i8