Recap: Plain Old Original:: String (Item 13)

I l @ ve RuBoard

Recap: Plain Old Original:: String (Item 13)

First, let's consider code examples that use a "plain old string" such as Item 13's Original::String that doesn't perform any copy-on-write (or other shared-information) optimizations under the covers. Whenever you copy or assign this kind of string, it immediately does a deep copy, so as soon as the copy or assignment operation is complete, you really do have two separate and independent string objects that aren't invisibly connected.

Given a plain old string, what does calling code have to do in order to use it safely in single- and multithreaded programs?

I l @ ve RuBoard


More Exceptional C++
More Exceptional C++: 40 New Engineering Puzzles, Programming Problems, and Solutions
ISBN: 020170434X
EAN: 2147483647
Year: 2001
Pages: 118
Authors: Herb Sutter

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net