
26 Jan
2009
26 Jan
'09
5:51 p.m.
AMDG Mathias Gaunard wrote:
arbitrary function objects can have many overloads of operator(), and there would need to be a way to specify which overload is associated with the memoizer.
Can't you just do something like
template<typename T1, typename T2, ..., typename Tn> result_type operator()(T1 t1, T2 t2, ..., Tn tn) { typedef boost::tuple<T1, T2, ..., Tn> tuple_type;
You'd need to be a bit careful about implicit conversions. If you have a monomorphic function object that takes double arguments, then passing ints and passing double will get memoized separately this way. In Christ, Steven Watanabe