
6 May
2006
6 May
'06
1:30 p.m.
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. :-)