Boost logo

Boost :

From: Pavol Droba (droba_at_[hidden])
Date: 2003-11-01 18:21:01

On Sat, Nov 01, 2003 at 10:01:08AM -1000, David Abrahams wrote:
> Pavol Droba <droba_at_[hidden]> writes:

> I would really, really like to see a use case which isn't handled more
> cleanly and just as easily with an iterator-based "find" algorithm.
> I think it's important not to shove functionality into a library
> before we can prove its usefulness. It's easy to add functionality
> later but it's very hard to remove it once a library is out.

There is one example, which alway hovers in my mind: Table manipulations.
You might want to make some tranformation in the second column for instance.

Problematic algorithm is not find_nth(). That one is realy covered by
find_iterator. But what about erase_nth and replace_nth?

Possible suggestion:


string str1="the text is text";
find_iterator it=make_find_first_iteraror("text");

//...advance to the second match

replace_range(str1,*it,"nonsense"); // str1=="the text is nonsense"


If this seem ok (in my opinion, it is), I will remove *_nth algos straight



Boost list run by bdawes at, gregod at, cpdaniel at, john at