[Issue 8411] core.time: No easy way to check if Duration is empty

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Mar 16 15:17:54 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=8411

Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |schveiguy at yahoo.com

--- Comment #3 from Steven Schveighoffer <schveiguy at yahoo.com> ---
I have a further, more difficult use case for this:

if(auto d = calculateSomeDuration())
{
   display(d);
}

This is not as easily worked around with the current API.

Adding opCast!bool was easy enough: https://github.com/dlang/druntime/pull/1793

--


More information about the Digitalmars-d-bugs mailing list