disabling unary "-" for unsigned types

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Feb 14 19:26:10 PST 2010


Justin Johansson wrote:
> Andrei Alexandrescu wrote:
>> Justin Johansson wrote:
>>> Andrei Alexandrescu wrote:
>>>> ulong x0;
>>>> static assert(!__traits(compiles, -x0));
>>>> uint x1;
>>>> static assert(!__traits(compiles, -x1));
>>>> ushort x2;
>>>> static assert(!__traits(compiles, -x2));
>>>> ubyte x3;
>>>> static assert(!__traits(compiles, -x3));
>>>>
>>>> Sounds good?
>>>>
>>>> Andrei
>>>
>>> Sounds excellent.  Who would have thought of that?
>>>
>>> Cheers
>>> Justin Johansson
>>>
>>
>> Actually Walter just talked me into forgetting about it. -x is 
>> conceptually rewritten into ~x + 1 for all types and typed accordingly. 
> 
> Oh, okay.  Who would have thought of that? :-)
> 
>> I'm dropping this in order to keep focused on more important changes.
> 
> This sounds good too.  We are all anxiously awaiting the publication of
> TDPL.  What's the latest ETA?

I'm on schedule for late April. With the chapter on concurrency (over 40 
pages alone), the size of the book has grown a fair amount. But hey, I 
even give two lock-free examples.

Andrei



More information about the Digitalmars-d mailing list