
Kirit Sælensminde wrote:
Thanks a lot for your time and explanations. Now that I understand more what boost::function_traits is trying to do it makes a lot more sense.
The documentation of function_traits (at least at http://www.boost.org/doc/html/boost_typetraits/reference.html#boost_typetrai... ) has no indication of what it is meant to do. Maybe something along the lines of this could be added to the documentation (the function pointer restriction is not very visible as the last example - it's only now that I've looked at the documentation a lot more closely that I've noticed it was there at all):
"function_traits is intended to introspect only C++ functions of the form R (), R( A1 ), R ( A1, ... etc. ) and not function pointers or class member functions. To convert a function pointer type to a suitable type use boost::remove_pointer."
Will do.
I hesitate to add something about using boost::mem_fn to convert a member function to a suitable type as I've not been able to get it to do it yet. I'm guessing that boost::mem_fn is intended to do one of the following two type transformations, but again it isn't clear from the documentation.
mem_fn does the same thing as std::mem_fn: it constructs a callable function object from a pointer to a member function, but without some of the limitations of the std version. John.