Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2000-09-17 06:12:35


I've almost got to the end of the changes requested to the regex library
during review, however there is one issue that's been niggling in the back
of my mind for a while now, currently regex matches are reported in an
instance of boost::match_results (this was called reg_match pre-review),
which is defined like this:

template <class iterator, class Allocator =
std::allocator<sub_match<iterator> > >
class match_results
{
        /* details */
};

However the allocator parameter here just kind of gets in the way. I put
it in place because the class does allocate memory, however in the long run
I feel that this would be better managed by its own internal memory manager
(as 90% of memory allocation occurs within the regex matching algorithms
internals). The parameter also acts as a variation point leading to code
bloat - it would be a lot easier for me to place algorithm specialisations
inside a dll if this just went away (most of the variation actually comes
from legacy support, and unfortunate previous design choices - but hey I
was making this up as I went along :-) whatever I now wish that this
particular template parameter wasn't there).

What do boosters feel about this? Should classes that allocate memory
always have an allocator parameter, or should that be restricted to
containers and container-like classes?

- John.


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