num-traits/src
Fabian Schuiki 21dfae004c Add checked shifts
Add traits `CheckedShl` and `CheckedShr` that correspond to the standard
library's `checked_shl` and `checked_shr` functions. Implement the trait
on all primitive integer types by default, akin to what the standard
library does.

The stdlib is somewhat inconsistent when it comes to the type of the
shift amount. The `checked_*` functions have a `u32` shift amount, but
the `std::ops::{Shl,Shr}` traits are generic over the shift amount. Also
the stdlib implements these traits for all primitive integer types as
right-hand sides. Our implementation mimics this behaviour.
2018-01-03 16:25:13 +01:00
..
ops Add checked shifts 2018-01-03 16:25:13 +01:00
bounds.rs Move num-traits to its own repo 2017-12-18 17:35:41 -08:00
cast.rs Move num-traits to its own repo 2017-12-18 17:35:41 -08:00
float.rs Move num-traits to its own repo 2017-12-18 17:35:41 -08:00
identities.rs Move num-traits to its own repo 2017-12-18 17:35:41 -08:00
int.rs Add checked shifts 2018-01-03 16:25:13 +01:00
lib.rs Move num-traits to its own repo 2017-12-18 17:35:41 -08:00
pow.rs Move num-traits to its own repo 2017-12-18 17:35:41 -08:00
sign.rs Move num-traits to its own repo 2017-12-18 17:35:41 -08:00