C ++ Boost binding value type
I'm looking at the documentation and source code, but I can't figure out how to get the return type of the boost bind function. I am trying to accomplish the 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 a connecting functor. the above doesn't work because the functor has no value_type. in this regard, there is a standard interface for a unary / binary functor with respect to the return value.
: it should be result_type
. also the equivalent is defined argument_type
and first/second_argument_type
for binary functions
thanks
+2
a source to share