Use case for std.bind

Lars Kyllingstad public at kyllingen.NOSPAMnet
Tue Feb 24 06:53:38 PST 2009


Lars Kyllingstad wrote:
>   struct Bar
>   {
>     auto tmp;
> 
>     pure real bar(real a) { return tmp + a; }
>   }

Correction: bar shouldn't be marked as pure here, or I guess it wouldn't 
have access to tmp. But you get my point:

It should be possible to factor out the calculations that only involve 
the curryed arguments, and only perform them once.

-Lars



More information about the Digitalmars-d mailing list