Search code examples
c++boostbind

C++ Boost bind value type


I look in documentation and source code but cannot figure out how to get return value type of boost bind functor. I am trying to accomplish following:

 35 template<typename T,size_t N, class F>
 36 boost::array<typename F::value_type, N> make_array(T (&input)[N], F unary) {
 37     boost::array<typename F::value_type, N> array;
 38     std::transform(input, input + N, array.begin(), unary);
 39     return array;
 40 }

where F can be bind functor. the above does not work because functor does not have value_type. for that matter, is there standard interface for unary/binary functor as far as return value.

solution: it should be result_type. also equivalent defined are argument_type and first/second_argument_type for binary functions

Thanks


Solution

  • Doh. nevermind, it's result_type rather than value_type.