Boost logo

Boost Users :

From: Delfin Rojas (drojas_at_[hidden])
Date: 2005-04-27 16:22:19


Hello all,

I am trying to get the return type of a member function given its signature.
Consider the following example from the boost result_of test:

struct X {};

int main
{
        using namespace boost;
      typedef int (X::*mem_func_ptr)(float);
        
        BOOST_STATIC_ASSERT((is_same<result_of<mem_func_ptr(X,char)>::type,
int>::value));
}

This test compiles/runs with no problems. Now, what I want is the return
type of a function with signature "int (X::*)()"

I added the following to the test:

typedef int (X::*empty_mem_func_ptr)();
        
BOOST_STATIC_ASSERT((is_same<result_of<empty_mem_func_ptr(X)>::type,
int>::value));

This does not compile. I get an error
boost_1_32_0\boost\utility\result_of.hpp(43) : error C2825: 'F::template':
cannot form a qualified name.

I tried to do this same thing with function_traits but it seems function
traits does not support member function pointers at all.

So this is all I have. If somebody can help me I would appreciate it.

Thanks

-delfin


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