29 Jul
2006
29 Jul
'06
12:31 p.m.
John Grabner wrote:
void LineTracker::Analyse(const std::string &Buffer) { boost::sregex_iterator m1(Buffer.begin(), Buffer.end(), expression); boost::sregex_iterator m2; std::for_each(m1, m2, *this); }
However for_each makes a copy of my class, so at the end it does not update the current instance with the results.
What do I need to do to have the the current instance receive the call back from regex?
You might be able to use boost::ref for that, but you know what: the easiest way is probably to not use for_each and just code the loop yourself. John.