disabling unary "-" for unsigned types

dsimcha dsimcha at yahoo.com
Mon Feb 15 18:32:52 PST 2010


== Quote from Ellery Newcomer (ellery-newcomer at utulsa.edu)'s article
> On 02/15/2010 05:33 PM, Steven Schveighoffer wrote:
> >
> > i.e.
> >
> > uint a = -1; // error
> I can't say I would appreciate having to write
> uint a = 0xFFFFFFFF;
> or the equivalent for ulong.

I always just use uint.max for such things.  Yes, it's a little more typing, but
it's clearer and saves me a few seconds of thinking.



More information about the Digitalmars-d mailing list