How can I go about determining return type of a member generic function?
template<class E>
struct result<E> {
// E has member function data(), I need to know its return type
typedef typename &E::data type;
};
is it possible to do it in generic way?
I know there is boost:: result_of
but for my purposes it lacks specializations (if I understood correctly, return type must be specialized).
boost implementation would be great.
GCC's nonstandard typeof operator can do this, as can Boost.TypeOf.
If you're using VS2010 or GCC 4.3 at least you can use C++0x new keyword decltype
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With