Boost logo

Boost :

Subject: Re: [boost] [string] proposal
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-01-28 15:49:56

Artyom wrote:
> From: Dean Michael Berris <mikhailberis_at_[hidden]>
> > And I stopped before I write too much -- the initial version is
> > already up:
> > <>
> >
> I'm sorry but this "document" full of mistakes
> and misses serious points:
> 1. "Contiguity"
> Continuity and c_str() is one of the most important
> properties of C++ string (that is BTW required by C++0x)

"Contiguity" is the correct word. "Continuous" is not.

> Reason: c_str() is a boundary to almost every library
> existing in C++ and C world. So removing this "bad" feature
> makes it useless for vast majority of string users.

Dean must address this use case in the document, but he has suggested ways to accomplish it in this thread.

> 2. Efficiency - have you forgotten about std::string::reserve?

That isn't automatic and many don't know to use it.

> 4. About string builder. Most languages require is as they
> don't have "reserve" also if you want efficient
> string builder use std::ostream with nice stream buffer.
> Don't copy paradigms that do not belong to C++!

Just because it hasn't been used in C++ doesn't mean it doesn't make sense.

> 5. Makeing all operations lazy you bring more segmentation
> to memory as it is not recycled, also it reduces
> performance as does not have "liner" location in cache/

The lazy approach means that until the result of the operations are needed, very little work needs to be done. When the result is needed, many operations can be combined into fewer net operations. The result is faster processing and better memory/cache usage.

> 6. Encoding is extrinsic to strings
> ?!?!?!
> All the discussion in started because we need UTF-8
> in strings now we are back to the beginning?

This is disingenuous. Dean has advocated that the encoding should be separate from the storage all along. In that sense, yes, he's going back to the beginning. Just because you think he should have been convinced by now that your view is correct doesn't mean that he's wrong.

> This is classic example of how trying to do something
> "cool" gives us theoretically interesting and cool things
> that are useless in real world where simple and straight
> forward things actually work a way better.

Simple and straightforward can always be implemented atop the "cool" if that's your only problem.

Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

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