25 Apr
2008
25 Apr
'08
10:32 p.m.
AMDG Robert Dailey wrote:
If you only need to deal with function pointers,
template<class T> void Subscribe(void (*callback)(const packet_t&)) { Subscribe(boost::function
(callback)); } What about for function objects?
There is no way to deduce what a function object can be called with
since it can have an overloaded operator(). To deal with monomorphic
unary function objects that follow the std library conventions, use this:
(warning untested.)
BOOST_MPL_HAS_XXX_TRAIT_DEF(argument_type);
template<class T>
typename boost::enable_if