On Wednesday 06 November 2002 4:24 pm, Andre Poenitz wrote: > On Wed, Nov 06, 2002 at 04:06:15PM +0000, Angus Leeming wrote: > > The whole point of this exercise was to clean-up the code in biblio.C. As > > a side effect, boost::regex searching now works in the same way as 1.2. > > 95 lines added, 71 removed... I'd like the other way round better...
Can you imagine that Lars would not have broken this if he'd caught sight of it at some stage in the future? // Loop over all keys from start... for (vector<string>::const_iterator it = start; // End condition is direction-dependent. (dir == FORWARD) ? (it<keys.end()) : (it>=keys.begin()); // increment is direction-dependent. (dir == FORWARD) ? (++it) : (--it)) { ... } > Is it necessary to have the simple/regex distinction at all? > regex alone should be sufficient, shouldn't it? Yes. Good point. I'll investigate further. > [Even if we want a "simple" item in the UI, the search pattern could be > mapped to a regexp.] > > > vector<string>::const_reverse_iterator rit(start); > > + vector<string>::const_reverse_iterator rend = keys.rend(); > + rit = std::find_if(rit, keys.rend(), match); > > Why not > > rit = std::find_if(rit, rend, match); > > if you already bothered to define it? done. Thanks. A