
Hi Terry, Terry Golubiewski schrieb:
If I have a class...
struct X { int f(double x); void f(int y); };
.... and a template Y that wants to deduce the return-type of some member functions of T...
template<class T> struct Y { typedef typename what_goes_here<T>::type f_double_return_type; typedef typename what_goes here<T>::type f_int_return_type; };
you should use boost::result_of to do such of things.
See
http://www.boost.org/doc/libs/1_43_0/libs/utility/utility.htm#result_of .
Here a description.
The class template |result_of| helps determine the type of a call
expression. Given an lvalue |f| of type |F| and lvalues |t1|, |t2|, ...,
|t/N/| of types |T1|, |T2|, ..., |T/N/|, respectively, the type
|result_of
I"ve tried using...
typedef BOOST_TYPEOF_TPL(static_cast
(0)->f(double(0))) f_double_type; // this works .... but ...
typedef BOOST_TYPEOF_TPL(static_cast
(0)->f(int(0)) f_int_type; // does not work for "void" Of course, I wouldn't know which one returns "void" or not ahead of time.
terry
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users