
4 May
2011
4 May
'11
3:02 p.m.
2011/5/4 Arno Schödl <aschoedl@think-cell.com>:
Hello,
is there a way to get the result type of an overloaded member function? Something like:
template< class T, class A >
typename boost::result_of< T::func(A) >::type invoke( T& t, A& a ) {
return t.func(a);
}
Would this be helpful? class C { public: int f(int); float f(int, float); }; BOOST_AUTO_TEST_CASE(decl_type) { BOOST_CHECK((boost::is_same< int, decltype( C().f(0) )>::value)); BOOST_CHECK((boost::is_same<float, decltype( C().f(0, 0.0) )>::value)); } Regards, Joachim -- Interval Container Library [Boost.Icl] http://www.joachim-faulhaber.de