Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-06-01 13:01:29


Alexander Terekhov wrote:

> Yeah, simply put, mutations of std::string object may invalidate
> references and iterators (with COW inspired semantics for non-
> const operator[]() et al. )... threads or no threads, COW or no
> COW.

Umm, not exactly.

int x = s[0];

(with non-const s) does not invalidate if COW isn't used, and two such
"reads" are MT safe. COW is visible in the presence of such functions. It's
still usable, but it isn't transparent.


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