开发者

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. th开发者_StackOverflow社区e 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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜