Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2006-07-29 08:31:57


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.


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