I'm trying to use the function traits to extract the return type of a template parameter,
but it's not compiling.
Any ideas what's wrong here?
-------- begin simplified code ------
template<typename Proc>
class CacheValue {
typedef boost::function_traits<Proc>::R ReturnType;
template<typename Arg1>
ReturnType operator () ( Arg1 arg1 ) { /* do something */ }
};
CacheValue
I'm trying to use the function traits to extract the return type of a template parameter, but it's not compiling.
Any ideas what's wrong here?
Yes, function_traits takes a function type as parameter, *not* a function
pointer type:
function_traits
-------- begin simplified code ------
template<typename Proc>
class CacheValue {
typedef boost::remove_pointer<Proc>::type np_type;
typedef boost::function_traits
-------- end simplified code ------
John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm
participants (2)
-
John Maddock
-
Marshall Clow