|
Boost : |
From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-06-28 11:13:10
At 05:57 AM 6/28/2001, Albrecht Fritzsche wrote:
>Darin Adler wrote:
>>
>> Beman suggested a simple string algorithms library. Some argued that
>> it was redundant with the standard library and not needed. But Beman
>> encouraged me to give it a shot anyway.
>
>Sorry if I missed something - why the string algorithms but not the
>string class itself?
>
>For me, at least, is the (lacking) efficiency of the string class the
>real problem, not the algorithms working on it. I mean, using things
>like the Small String Optimization, policies, etc.. it should be
>possible to build a better string class which is configurable for
>different uses and much more efficient than the string class that
>most libraries offer.
>
>But maybe you are already working on that?
Boost tends to concentrate on pure extensions to the standard library
rather than so-called impure extensions that would change the existing
standard library.
Of course a new_string class (or rope or whatever) could be done as a pure
extension, but then the issue of third-party library interoperability would
have to be addressed.
Also, be aware that a highly configurable string class, with more policies,
traits, etc. would be seen as "better" by some but decidedly "worse" by
others, who are concerned that parameterization discourages users. I think
the rule-of-thumb for user-supplied template parameters might be something
like:
You get one simple template parameter like T or N for free, and
then every addition parameter halves the number of users.
All that should not discourage you from trying to design a new string
library. The performance working group of the standards committee has
suggested that a non-modifiable (or maybe it was fixed-length - I'm not
part of that group and don't know the details) string would serve many
needs and yet be more efficient. I thing someone on Boost was talking
about such a string not too long ago.
Cheers,
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk