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 aValue;
-------- end simplified code ------
Gets the error:
Error : illegal use of incomplete struct/union/class 'boost::detail::function_traits_helper'
(point of instantiation: 'main()')
(instantiating: 'CacheValue')
(instantiating: 'boost::function_traits')
function_traits.hpp line 170 public detail::function_traits_helper
Error : 'R' is not a member of class 'boost::function_traits'
(point of instantiation: 'main()')
(instantiating: 'CacheValue')
HelloWorld.cp line 57 CacheValue<TickGetter> ticks ( GetCount );
Environment:
MacOS 10.2.2, CodeWarrior 8.3, boost from CVS this morning.
It seems as if the "add_pointer" in function_traits_helper is messing things up.
Of course, it's more likely that I am using this wrong ;-)
Thanks in advance!
--
-- Marshall
Marshall Clow Idio Software mailto:marshall@idio.com
Hey! Who messed with my anti-paranoia shot?