On Mon, 15 Feb 2010 21:32:21 -0500, Rainer Deyke <rain...@eldwood.com> wrote:

Ellery Newcomer wrote:
On 02/15/2010 05:33 PM, Steven Schveighoffer wrote:
uint a = -1; // error

I can't say I would appreciate having to write

uint a = 0xFFFFFFFF;

or the equivalent for ulong.

uint a = ~0u;

even ~0 works, no need for the u (although it makes things clearer).

Ellery, you didn't read my original post thoroughly, I said this was the most common case of wanting to use unary negative on an unsigned value, and it's easily rewritten, with the same number of characters no less.

-Steve

Reply via email to