Make @shlExact() more ergonomic when type casting #4076
Labels
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
Currently using
@shlExact(value: T, shift: Log2T) T
gets very messy when using values that aren'tcomptime
, for example:I think it would be much cleaner to use
@shlExact(T: type, value: T, shift: T) T
thus:It would still provide all the same safety checks, it is just way neater.
Also, it might be nice to have a matching function
@shl
like:That's kinda redundant I guess, but it would give a standard and clean way to do this cast and the symmetry between
@shl
and@shlExact
seems nice to me.The text was updated successfully, but these errors were encountered: