
5 May
2006
5 May
'06
11:55 a.m.
Hossein Haeri wrote:
Dear all,
A fragment of code of mine is like this:
template
struct print { ostream& operator () (const Container& c, ostream& out) const { if(out) { typedef typename Container::value_type value_type; typedef print NewPrint; NewPrint newPrint; for(typename Container::const_iterator j = c.begin(); j != c.end(); ++j) newPrint(*j, out); /*for_each(c.begin(), c.end(), bind(newPrint, _2, out)); //Error!*/
bind( newPrint, _1, boost::ref(out) ); //untested I'm not sure why you thought you would use _2? Jeff Flinn