Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2005-06-03 04:50:52


>> Sorry, I'm being dense today: what do you mean by that?
>
> instead of checking every what[i].matched as in the following
>
> for (unsigned int i = 1; i < what.size(); ++i) {
> if (what[i].matched) {
>
> I'd like to be able to have the subexpressions that matched accessible
> directly. Something like
>
> for (unsigned int i = 1; i < what.submatched.size(); ++i) {
>
> so, if I have, say, 10 subexpressions, and only two matched, instead of
> checking every what[i] (for i = 0..9), I could access directly to those
> two subexpressions. It'd be much more efficient.

Hmm, it depends on what you want to do I guess: how would tell what index
those two sub-expressions were, or don't you care? It also means a complete
rewrite of the match_results interface, and probably the code that finds
matches as well - it all assumes that match_results is basically an array of
N sub-expressions.

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk