Default-valued nothrow @nogc std.conv:to

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 22 11:26:56 PDT 2017


On 4/22/17 6:57 PM, Stanislav Blinov wrote:
> On Saturday, 22 April 2017 at 16:41:00 UTC, Nordlöw wrote:
>
>>> If defaultValue is not lazy, it's potentially wasteful.
>>
>> What do you mean with "potentially wasteful"?
>>
>> Excess calls to copy constructors?
>
> Evaluation of an expression the result of which might not be used.
> defaultValue could be anything: a literal, an lvalue, a result of a
> function call...

IMO you are overenginering this. defaultValue will most likely be 
something distinct such as compile-time constant.

---
Dmitry Olshansky


More information about the Digitalmars-d mailing list