memoize

Simen kjaeraas simen.kjaras at gmail.com
Tue Jan 4 05:54:29 PST 2011


Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote:

> On 1/4/11 12:30 AM, Guilherme Vieira wrote:
>> Is there really need for ParameterTypeTuple? I figured this works:
>>
>>         template memoize(alias fun, uint maxSize = uint.max)
>>
>>         {
>>
>>              auto memoize(Args...)(Args args)
> [snip]
>
> That would create several caches, depending on calls with convertible  
> arguments.
>
> Andrei

So the solution should use a struct with overloaded opCall, then.

-- 
Simen


More information about the Digitalmars-d mailing list