A
Alex Rubinsteyn
Hi,
I can't figure out why my function templates don't resolve properly.
Anyone here want to help me out?
I can't figure out why my function templates don't resolve properly.
Anyone here want to help me out?
Code:
---
template <typename T>
Obj* call_method (T* t, void (T::*f)())
{
(t->*f)();
return Void;
}
template <typename T, typename Ret>
Obj* call_method (T* t, Ret (T::*f)())
{
return cpp_to_hyrax((t->*f)());
}
....
I instantiate the template with:
---
T* t = new T;
Obj* o = call_method<T, void> (t, &T::func);
---
T::func's signature is void().
It seems to me that the first template ought to be instantiated, but
it's the second one that wins. Any clues why?
Thanks for any help,
-Alex