Optional parameters referring to previous parameters?
Mehrdad
wfunction at hotmail.com
Thu May 10 05:53:10 PDT 2012
On Thursday, 10 May 2012 at 11:54:42 UTC, Steven Schveighoffer
wrote:
> I *love* this idea.
:D
> Although, what happens if the expression for items is costly?
> We have to make sure if you do:
>
> process(someExpensiveCalculation());
>
> it doesn't turn into:
>
> process(someExpensiveCalculation(),
> someExpensiveCalculation().length);
It should be evaluated once anyway, since it might have side
effects.
More information about the Digitalmars-d
mailing list