Thank you for a much needed crate!
We have been very successful in replacing the type hierarchy in common_traits with num-primitive and num-crates in dsi-bitstream.
We were wondering if there's in the works something like num-primitive for atomic types (or we could try to write one).
Another thing that would be nice to have is a trait for conversion without loss of precision, like in az::StrictCast or common_traits::UpcastableInto. One can convert, say, between signed and unsigned types of the same size with a bit of juggling and AsPrimitive, but I haven't found any way to write a bound implying "this can be cast into a u32 without loss of precision".
Thank you for a much needed crate!
We have been very successful in replacing the type hierarchy in
common_traitswithnum-primitiveandnum-cratesindsi-bitstream.We were wondering if there's in the works something like
num-primitivefor atomic types (or we could try to write one).Another thing that would be nice to have is a trait for conversion without loss of precision,
like in az::StrictCastorcommon_traits::UpcastableInto. One can convert, say, between signed and unsigned types of the same size with a bit of juggling andAsPrimitive, but I haven't found any way to write a bound implying "this can be cast into au32without loss of precision".