http://d.puremagic.com/issues/show_bug.cgi?id=9999


Martin Nowak <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]


--- Comment #5 from Martin Nowak <[email protected]> 2013-04-27 15:29:18 PDT ---
I can't come up with a use-case for '1' to bool conversion.
We already deviate from C++ as there is no implicit integral to bool
conversion.

bool b = 0;                 // implicit, questionable
bool b = 1;                 // implicit, questionable
bool b = 3;                 // error
bool b = int_val;           // error

bool b = cast(bool)int_val; // explicit

int i = false;              // implicit
int i = true;               // implicit
int i = bool_val;           // implicit

int i = cast(int)bool_val;  // explicit

The if-condition is handled as explicit cast(bool)expr right?

if (0) {}                   // explicit
if (int_val) {}             // explicit

Now one thing that worries me is that we already had a similar discussion with
short/long overloads.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to