Boost logo

Boost Users :

From: Alexander Shyrokov (shirokov_at_[hidden])
Date: 2006-09-15 12:32:22


>>> 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);
      }
};
std::vector<std::vector<bool> > vec;
std::for_each(
       vec.begin(), vec.end()
       , boost::bind( resize_vector_bool<std::vector<bool>,int>(), _1, 10));

-- 
Regards,
     Alexander.                http://sjcomp.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net