
Alexander Shyrokov wrote:
struct resize_vector_bool
Should'nt that be
struct resize_vector_bool : public std::binary_function<V,N,void> ?
Thanks Hendrik, it solved the problem though I had to define template parameters. This is the final working version:
template <class V, class N> struct resize_vector_bool : public std::binary_function<V,N,void> { void operator()(V& v, N n) const { v.resize(n); } };
If you want to go this way (there's nothing wrong in practice with using &vector<>::resize IMO), you only need to either: 1. Define result_type: struct resize_vector_bool { typedef void result_type; void operator()(V& v, N n) const { v.resize(n); } }; or 2. Supply it at the bind call by using bind<void>( ... ). This approach avoids having to specify V and N at the bind call.