DMD 0.149 release
Derek Parnell
derek at psych.ward
Tue Mar 7 18:12:17 PST 2006
On Tue, 7 Mar 2006 21:02:11 -0500, Ameer Armaly wrote:
>
>> Now what happens to
>>
>> if (stcmp("foo", "bar")) {}
>>
>> ???
> This has some merrit to it in my opinion; what's wrong with beeing able to
> cast an int to a bool; it allows the above stated functionality, but doesn't
> really present any harms that I can see.
You *can* cast an integer to a bool, but it must be explicit and no
implicit.
bool x = cast(bool)42; // okay
bool x = 42; // not okay
--
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocracy!"
8/03/2006 1:11:07 PM
More information about the Digitalmars-d-announce
mailing list