Boost logo

Boost :

From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2004-09-20 09:47:48

David B. Held <dheld_at_[hidden]> wrote:
> Maxim Yegorushkin wrote:
> > I've been working on a small library - an immutable C++ string. Now
> > it is in usable state and has been put in use in a couple of real
> > projects. Although it needs further polishing, I would like to know
> > is there any interest in such a library?
> >
> > Here is the link:
> First, I'll say that yes, I am very interested in a library such as
> this. Second, let me say that "const_string<>" and "immutable string"
> don't seem like the right terms to me. The fact that you can call
> operator?=() and append() on it tell me that there is little that is
> "const" or "immutable" about it. It seems to me that "cow_string<>"
> would be more appropriate, but perhaps others have different opinions.

I once wrote a string template class similar to this, though without the
clever storage policy. Unfortunately this was done in the course of my
employment and I left that job without having got permission to make it
public. Anyway, I think the name I settled on was atomic_string.

> I suppose its not completely a COW string, since you don't support the
> full set of mutating operations.

It never modifies buffers once they've been initialised, so it has no
use for COW.


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