Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-01-17 05:53:16


tom gee wrote:
> void A::FillAllLines()
> {
> ...
> // method 1
> for_each(m_v.begin(), m_v.end(), boost::bind(&A::FillOneLine,
> this,_1)); // OK
> // method 2
> for_each(m_v.begin(), m_v.end(), boost::bind(&A::FillOneLine,
> this, ref(_1))); // error
> ...
> }
>
> Since ONE_RECORD can be large, I prefer to calling bind() as method
> 2, but, compiled under VC7.1 it generates such an error: [...]

_1 is always a reference to the first argument. You don't need to wrap it
with ref().


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