Boost logo

Boost :

Subject: [boost] Boost.StringAlgo:library defects?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2009-07-29 09:58:06


As I integrated my Unicode library with Boost.StringAlgo, I noticed a
few issues:

- The Finder concept seems inappropriate, since
find_iterator<last_finderF> can't work as expected. I suggest building
left-to-right and right-to-left searching directly into the Finder concept.

- Certain functions that take ranges only take Range& and not const
Range&. Interestingly enough, in the cases where I've found it does that
a const Range& would have been enough.

- Usage of the Finder concept is incompatible with its definition.
Indeed, finders are passed by const reference, which means the
operator() must be const, unlike in the examples.

- Finders are explicitly calling boost::as_literal on the string to
search for, which I believe should not be their responsibility but that
of the callee (or not, but I would have expected a rationale at least).

- Why is there no trim variant that simply returns a sub range of the
input range? There are only ways to modify the sequence in-place or copy
a trimmed one.

- Algorithms such as find being pushed in the boost namespace is
incompatible with, for example, updated version of Boost.Range
(Boost.RangeEx).
Since boost::algorithm::find is quite different from std::find, it
should not be promoted to boost::find.

Since the library is fairly old (2002), I assume some of these issues
are known.
Is there any plan to fix them?


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