Function fits [src]
Returns whether self can fit into an integer of the requested type.
Prototype
pub fn fits(self: Const, comptime T: type) bool
Parameters
self: Const
T: type
Source
pub fn fits(self: Const, comptime T: type) bool {
const info = @typeInfo(T).int;
return self.fitsInTwosComp(info.signedness, info.bits);
}