
3 Mar
2010
3 Mar
'10
9:33 a.m.
Jesse Perla wrote:
Not sure if this is what you want, but I was pointed to the following previously:
http://www.boost.org/doc/libs/1_42_0/doc/html/proto/appendices.html#boost_pr...
pendices.implementation.function_arity
Exactly what I was looking for! I knew there had to be some nifty trick.. Thanks!
This works for most function objects, but not for function pointers. To implement those, I ended up doing a dispatch and determining if the arguments were convertible.
Please find attached my take on it. It should work for function pointers, function references, member function pointers, and function objects. Perhaps we can shave it up a bit further and propose to type_traits lib or the like.. Cheers, Rutger