Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2007-10-04 05:06:15


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_typetraits.function_traits
> ) 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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net