Boost logo

Boost :

From: Pavol Droba (droba_at_[hidden])
Date: 2002-11-27 12:56:44


Hi Alexei

On Wed, Nov 27, 2002 at 11:09:47AM -0500, Alexei Novakov wrote:
> Pavol,
>
> To make things clear, I do not want to sound like I am opposing to what you
> are doing.

Thats ok:) Every opinion is worth considering for me

> I really think that these algorithms are usefull and very usable.
> Only point I want to emphasise is the necessity to have these algorithms
> implemented in string oriented fassion (maybe in parallel with generic
> ones). String oriented algorithms would give you the following advantages
> and additional functionality:

I try to explain what are my intentions to support your points. Maybe
you will disagree, and we can discuss it in more detail.

> 1) They would make implicit use of char_traits methods, which are ignored
> now by default.

For now, I haven't encountered a need for any char_trait specific features.
Functionality provided there is based on char* types and since algorithms
should not have access to internal representation of the string,
I consider them irrelevant for string_algo lib.

> 2) Possible string optimizations, which would be important for string
> intensive programs.

This is a good point, however all string algorithms are mostly sequencial
in the nature so the iterator based implementation is not worse when compared
to some string specific one, at least, I don't know about any improvement
I could make to the algorithms I have implemented, that would make them much better.

> 3) More convenient signatures for those (majority as you agreed) who whould
> use it with strings.

There are variants for all algorithms which take a generic sequence as an argumnent.
So you can use basic_string as a parameters without any special efford.

I know that if would be nice to be able to allow to pass a char* as an argument.
There is another boost library being developed, called container_algo lib. Almong other
features it should provide a unified access to any sequence stl or non-stl one
using free-standing operations like begin/end. It would also encapsulate char*
and alike. I have disscused this issue with the Thorsten Ottosen, who is working
on the container_algo lib, and we have aggreed that I will make the string_algo
library compatible with container_algo.

So when both libraries will be ready you will not need string specific overrides,
everythign will work fine automaticaly.

Anyway, I understand quite well a need to flexibility. I'm trying hard now to
make string_algo lib open to extension in all possible ways. So that
each algorithm could be specialized of modified to any user type and need
If will be easy to make a specialization for basic_string if it would be
required. However first I have to win a war with VC7 and alike compilers :)

Regards,

Pavol


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