
25 Jan
2009
25 Jan
'09
9:35 p.m.
Mathias Gaunard wrote:
It would be better if it worked with any function object. Thus the return type cannot be memoizer<int (int, int)>, unless you also perform type erasure, which would be fairly silly.
I'm still considering the syntax for that. It's simple enough for boost::functions, but for generic function objects, it's not clear to me what the syntax should be, since a function object could potentially have many overloads of operator(). Perhaps syntax like memoizer<int (FunctionObj::*)(int, int)> would work? - Jim