18 Sep
2008
18 Sep
'08
9:17 p.m.
AMDG Christoph wrote:
Do function_traits work with functors?
I tried with
struct XYZ { bool operator() (int x) const { return x+2; } };
<snip>
Err, what do you want to happen for an overloaded or templated function object? struct f { template<class T> void operator()(const T&) const; };
Is there a way to achieve the function_traits functionality with function_traits or some other type_traits?
You can try typedef BOOST_TYPEOF(FUNCTION::operator()) mf_type; Then mf_type will be (e.g.) int (XYZ::*)(int) const, which can be broken down by the Function Types library. In Christ, Steven Watanabe