Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-05-06 09:30:51

Hossein Haeri wrote:
> Hi Steve.
>> I get it (on VC++2003) as the problem being a lack
>> of return_type typedefs.
> Doesn't work for GCC 3.3.1 either! :(


> for_each(c.begin(), c.end(), bind(newPrint, _2,
> out));

You've already been advised to use:

for_each(c.begin(), c.end(), bind(newPrint, _1, ref(out)));

Remember, for_each only passes one argument, you can't use _2 to select the
non-existent second one, and your noncopyability problem is solved by using
boost::ref. You even asked "is there an equivalent to boost::ref" in your
original post. Yes there is, it's called boost::ref. :-)

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at