DIP 1017--Add Bottom Type--Final Review
12345swordy
alexanderheistermann at gmail.com
Tue Jan 22 14:26:53 UTC 2019
On Tuesday, 22 January 2019 at 10:23:09 UTC, Nicholas Wilson
wrote:
> On Tuesday, 22 January 2019 at 06:57:24 UTC, Neia Neutuladh
> wrote:
>> Point of pedantry: bool is an integer type according to the
>> type specialization rules, a more specific subtype of 'int'.
>> It can participate in some arithmetic expressions, though it
>> omits things like ++ and +=.
>>
>> So you can write things like:
>>
>> i = i + true | ((true + true) ^^ (true + true + true) ^
>> false);
>>
>> And this code uses the bool overload:
>>
>> void foo(bool b) { writeln("bool"); }
>> void foo(short b) { writeln("ubyte"); }
>> foo(cast(ubyte)0);
>>
>> I'm not sure anyone but Walter thinks this is a good idea.
>
> Indeed, hopefully we can convince Andrei to reverse the
> decision on DIP1015 at dconf.
Good luck with that, you going to need it.
More information about the Digitalmars-d
mailing list