Boost logo

Boost Users :

From: Alexander Shyrokov (shirokov_at_[hidden])
Date: 2006-09-14 12:49:31


David Abrahams <dave <at> boost-consulting.com> writes:
> And then there's the minor detail that you're not allowed to take the
> address of standard library (member) functions... to be technically
> portable and correct, you need to write a wrapper, e.g.
>
> struct resize_vector_bool
> {
> template <class V, class N>
> void operator()(V& v, N n) const
> {
> v.resize(n);
> }
> };
>
> and then you can go back to using two arguments:
>
> std::for_each(
> vec.begin(), vec.end()
> , boost::bind( resize_vector_bool(), _1, 10));
>

If I do it the correct way I get:
boost_1_33_1\boost\bind.hpp(63) : error C2039: 'result_type' : is not a member
of 'Geometry::resize_vector_bool'

I've tried to convert it into a function, but it did not help.

Why does that happen?

Thanks.


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