Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-07-31 10:22:01


Minkoo Seo wrote:

> vector<int> vi2;
>
> for_each(vi.begin(), vi.end(),
> if_then(_1 == 1, vi2.push_back(_1)));

> Does anybody know how to push _1 into vi2? I've tried bind( ), but no
> luck.

bind( &std::vector<int>::push_back, &vi2, _1 ) should work.


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