www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Docs 6.9.4: Implicit Conversion to bool

reply Manfred Nowak <svv1999 hotmail.com> writes:
Having a function `f' overloaded for argument types `bool' and 
`ulong', the specs guarantee, that for `f( 1uL)' the boolean 
overload of `f' is called.

What is this good for?
Mar 09 2020
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 3/9/20 11:35 AM, Manfred Nowak wrote:
 Having a function `f' overloaded for argument types `bool' and `ulong', 
 the specs guarantee, that for `f( 1uL)' the boolean overload of `f' is 
 called.
 
 What is this good for?
You're not the first person to ask. https://github.com/dlang/DIPs/blob/master/DIPs/rejected/DIP1015.md -Steve
Mar 09 2020
parent Manfred Nowak <svv1999 hotmail.com> writes:
On Monday, 9 March 2020 at 16:44:55 UTC, Steven Schveighoffer 
wrote:
 You're not the first person to ask.
Accepted.
Mar 09 2020