|
Boost : |
From: Edward Diener (eddielee_at_[hidden])
Date: 2002-10-19 08:17:01
"John Maddock" <jm_at_[hidden]> wrote in message
news:018b01c2775b$868fde60$4d3287d9_at_1016031671...
> > The boost::match_results<> class has a size_type for the number of
> > substrings but the various functions for obtaining substring match
> > information use:
> >
> > operator[](int)
> > str(int)
> > position(unsigned int)
> > length(unsigned int)
> >
> > First, might it not be better to regularize all of this on the size_type
?
> I
> > realize that -1 and -2 return special sub-matches but the different int,
> > unsigned int, and size_type integral types seem confusing.
> >
> > Also, the documentation is wildly inconsistent in this area, neither
> > matching the implementation in all cases or even matching itself <g> in
> all
> > cases.
> >
> > Could all of this please be cleaned up a bit in the next release, at
least
> > to the point of getting the documentation in sync with the itself and
the
> > implementation, if not getting the functions above regularized ( I vote
> for
> > size_type in all cases with a needed cast to -1 and -2 if size_type is
> > indeed an unsigned type ).
>
> OK some more for my TODO list, I want to replace negative indexes with
> prefix() and suffix() member functions BTW.
Good idea. That makes it easier to use boost::match_results<>::size_type as
the index for all sub-string info, and regularizes the access.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk