Re: CoW and reference counting in the STL
On Apr 14, 4:38 pm, Daniel Kr?gler <daniel.krueg...@googlemail.com>
wrote:
On 14 Apr., 20:44, s5n <sgb...@googlemail.com> wrote:
My question might be slightly off-topic, as it is specific to the STL
(and in fact specific to implementation-defined features), but this is
the best place i know to ask...
The question is not off-topic at all.
std::string typically uses reference counting and CoW to reduce real
allocations to a minimum. i understand that this is an implementation-
defined detail, not standardized, but in my experience STL
implementations do this.
Yes, this is a valid implementation technique for C++03,
but no longer valid for C++0x. Todays implementations often
take advantage of the small-string optimization, though.
Why is CoW no longer valid for C++0x? Is it due to move semantics?
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]