Boost logo

Boost Users :

Subject: Re: [Boost-users] [result_of] member function
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-02-28 21:14:51


AMDG

er wrote:
> Thak you for your answer. I was probably misinterpreting the part that
> reads
>
> The implementation permits the type F to be a function pointer,
> function reference, member function pointer, or class type.
>
>
> in the doc of result_of. Is someone aware of an example that
> illustrates the "member function pointer" part?

It works like this:

struct S {
    int f(int);
}
typedef int (S::*f_type)(int);
typedef boost::result_of<f_type(S*, int)>::type f_result_type;

Note that this is not very useful if you want to deduce the return
type of the function named f in some arbitrary class, because you
need to know the type of the member function pointer to
use result_of.

In Christ,
Steven Watanabe


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