On 1/4/11 7:54 AM, Simen kjaeraas wrote:
Andrei Alexandrescu <[email protected]> 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.

1. I think it's best to map a function to a function for best impedance match.

2. If you memoize an overloaded function, you _do_ want several caches.


Andrei

Reply via email to