Boost logo

Boost :

Subject: Re: [boost] GSoC Proposal Preparation For Encoding Awared String
From: Soares Chen Ruo Fei (crf_at_[hidden])
Date: 2011-03-28 16:53:09


Sebastian Redl wrote:
> On the contrary, the only CoW string I know is that from GCC's libstdc++, and that one will have to change: C++0x prohibits CoW implementations of std::basic_string.

Artyom wrote:
> Almost All implementations I know (but MSVC) use CoW strings, GCC, HP, SunCC and more.
> Shame on C++0x that CoW was removed for really irrelevant reasons.

Thanks for pointing out that C++0x actually bans CoW in basic_string,
Sebastian and Artyom. So far I've only found N2668 [1] mentioning this
change, and there is little I can find through Google search. If you
have links that provide detailed information on this change, please do
let me know.

As I understand, the ban is basically due to the inefficiency of
performing concurrent mutation of basic_string, especially when the
mutation is done through iterators. I believe that this serves as
evidence that immutable string can be more desirable, and that mutable
iterators are hard and the only reason to use them is to stay
compatible with STL algorithms.

I also see that the standard committee recommend a rope proposal be
considered for inclusion in Library TR2. Probably this is what
Boost.Chain should be heading to?

Stewart, Robert wrote:
> Please read <http://www.boost.org/community/policy.html#quoting>.

I am really sorry to not know about the quoting convention in this
mailing list. Hopefully starting from this post I am following the
policy correctly. Thanks for letting me know.

Anders Dalvander wrote:
> I've reviewed Chad's library and his ideas of a Unicode string class gave inspiration for my Unicode string class, although with different design and intermediate goals.

I'm glad to see somebody shows support to Chad's library and the idea
of Unicode string class. I believe that as long as we all have the
same goal in mind, we can eventually sort out the design and
implementation details to create a Unicode string library that is
useful for everyone. Perhaps I should also discuss with you about my
ideas in IRC and private mails.

> I did so to ensure that the data was shared between instances, as some implementations does not use COW semantics.

As Sebastian and Artyom mentioned that CoW is prohibited in C++0x, so
I guess that we have no other choice other than to deal with non-CoW
strings.

> The basic_text class was initially designed to be immutable, but I don't know if that is always good. Now I think it would be better if instances could be appended at the end, that way one could use Mathias Gaunard's Unicode library without any intermediates.

I have the same idea with you that append operation is desirable,
which I've mentioned in an earlier post. Currently I have some ideas
on how to solve these design challenges, but they are not yet matured
enough for me to share it here.

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2668.htm

Best Regards,

Soares Chen


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