Boost logo

Boost Users :

Subject: Re: [Boost-users] Regex Design trap
From: John Maddock (boost.regex_at_[hidden])
Date: 2010-09-09 11:29:55


> But one point stays open yet: Why returning the matches as out parameter
> instead as return value?

If you need to perform many repeated matches on the same regex then re-using
the same match_results each time saves regex_search from having to perform
any memory allocation: again it's a big win in performance terms. You can't
do that if the structure is returned by value.

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