
12 Oct
2007
12 Oct
'07
6:26 a.m.
On 10/11/07, Marco <mrcekets@gmail.com> wrote:
The set<signature_type>(f) and set<index>(f) are needed to manage overloaded and polymorfic function objects. That is if the functor is compatible with more than one signature the signature_type and the index are no more redundant but necessary.
Suppose you have a class class A { void foo(char); void foo(long); }; Now one question: the compiler allows a call like this? A a; a.foo(7); (Hint mine no) So I would say a _possible_ policy is to not allow to register say set(f6); if is already registered a function with a "compatible" signature. This is both more safe (IMHO) and avoid complications in the API Just an opinion Marco