tags:

views:

85

answers:

1

hello.

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

+2  A: 

Doh. nevermind, it's result_type rather than value_type. should i delete this question?

aaa
Not much you can do. Change the title, maybe. Not sure if OP voting to close just counts as just a vote, or if you can vote to close at 3500.
Potatoswatter