Interesting user mistake

Mint via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 5 09:32:25 PDT 2015


On Saturday, 5 September 2015 at 10:45:35 UTC, ponce wrote:
> On Friday, 4 September 2015 at 18:55:03 UTC, Mint wrote:
>> On Friday, 4 September 2015 at 17:17:26 UTC, Andrei
>>
>> A simple solution would be to just have unary + perform 
>> integer promotion, as it does in C.
>
> Wait, what? Is this another secret difference from C integer 
> promotion rules?

To me knowledge, the unary '+' in D is essentially a no-op (much 
like it is in Java). Mimicking C promotion rules might help new 
programmers coming to D from C or C++ feel more familiar with the 
language. The caveat here would be that the unary '-' operator 
would need to also perform a similar promotion for consistency.


More information about the Digitalmars-d mailing list