Unsigned comparison operators

Stefan Koch uplink.coder at googlemail.com
Fri Sep 29 14:13:07 UTC 2017


On Friday, 29 September 2017 at 11:20:13 UTC, Cecil Ward wrote:
> I love the D >>> operator and I use it a lot. So much safer 
> than the chaos in C.
>
> I would absolutely love to have unsigned comparison operators 
> in D. Do you agree? What on earth would the syntax be like?
>
> Yes, I could write a generic function or something, but the 
> result would look ugly. And I would have to be very careful not 
> to screw up type conversions (although i’m pretty sure there is 
> some help available in the rtl to assist in getting the job 
> done safely).

I have a hard time imagining a use case.

The reason why he have signed shift in the first place is to make 
the (n >> m) be equivalent to n * (2^^m)



More information about the Digitalmars-d mailing list