
Marco Costalba wrote:
On 10/8/07, Joel de Guzman <joel@boost-consulting.com> wrote:
There's no way to detect the signature of a template function (the operator()):
Perhaps you don't need this. You only need to check if the template function operator() matches one signature in the Signatures set.
I have found this nice (and very small) code from Paul Mensonides that seems to works (at least for me)
http://www.mail-archive.com/boost@lists.boost.org/msg00164.html
The limitation is that you have to specify the type of the function, but in our case is not a problem because we have a finite set called 'Signatures' among which to choose the operator() type.
As you can see from his testing example:
[snip code]
And check each one with has_function_call() until a match is found or return an error otherwise.
Easier to say then to do ;-)
Cool! So if the RHS is a polymorphic function then it can be assigned to all of the compatible Boost.Function objects? Nice! Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net