
22 Jan
2011
22 Jan
'11
1:43 p.m.
On Fri, 21 Jan 2011 15:31:16 -0600, Nevin Liber wrote:
On 21 January 2011 10:55, Dave Abrahams <dave@boostpro.com> wrote:
Do you want to prevent 1. wholesale mutation such as
x = y x += y
or just
2. per-char mutation such as
x[10] = 'a'
?
Eliminating #2 but not #1 would force c_str() to make a (possibly tracked) copy, to avoid #2 on its internal buffer (due to the trailing '\0' byte).
Why does the trailing '\0' affect anything. It could store the immutable string data internally in a buffer that has an extra '\0'. The time it considers this '\0' to be part of the data is on a call to c_str(). Alex -- Easy SFTP for Windows Explorer (http://www.swish-sftp.org)