Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2003-10-18 06:36:28


Thorsten Ottosen wrote:
> The review of Pavol Droba's string algorithms library starts today and runs
> until the 30th of October.

I looked at the library and I think it should be accepted. I have one
big concern, though, which IMHO must be addressed:

* The default should be copying algorithms, not modifying algorithms!

When I write to_upper( str ), a copy of str should be returned. This is
important as most users IMHO expect this. Maybe some other syntax for
the modifying version can be found. Some ideas:

   to_upper_inplace( str ); // easy

or

   apply( to_upper, str );

The latter is possible if to_upper is an object of a type to_upper_t
with appropriate operators:

   std::string to_upper_t::operator()( const std::string& str ) const;
   std::string& apply( const to_upper_t&, std::string& str );

I thinks it's reasonable to expect those that want optimizations to do a
little more work and those that don't care and want the easiest syntax
to have a safe library.

* Another point I was missing is the classic counterpart of trim: pad. I
think that this algorithms should be added to extend a string to a given
minimum length. I think most people know what pad (pad_left, pad_right,
...) does, if you want me to elaborate, just let me know.

* I missed a small overview table to show which algorithms are provided,
probably at the very beginning of the library. The closest thing I could
find is the header overview, but I'd like to have a much briefer table
in the first section of the documentation.

* The documentation contains the docs for detail::-stuff. But, well,
those are details and probably are only bloat for the documentation.
Even worse: People will use them, as they are documented :)

* Some typos: grep for "mathing" (should probably be "matching").

Regards, Daniel

-- 
Daniel Frey
aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de

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