
2 Oct
2009
2 Oct
'09
4:55 p.m.
Is may be Boost.FunctionTypes what you are looking for? http://www.boost.org/doc/libs/1_40_0/libs/function_types/doc/html/boo...
It looks like right area, but i can't see how would I apply these.
function_type expects mpl sequense.
Maybe what you need is a combinatioin of FunctionTypes and TypeTraits //example with type_traits/function_traits #include<boost/static_assert.hpp> #include<boost/type_traits/function_traits.hpp> struct newf : boost::function_traits<int(int,int)>{ BOOST_STATIC_ASSERT(arity==2); result_type operator()(arg1_type a, arg2_type b){ //or result_type operator()(first_argument_type a, second_argument_type b){ return a+b; } };