
1 Mar
2009
1 Mar
'09
2:14 a.m.
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