From -3564202752685539200
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,b83a4267f4ac775
X-Google-Attributes: gidf78e5,public
From: phalpern@truffle.ma.ultranet.com (Pablo Halpern)
Subject: Re: string/cow/algorithm
Date: 1998/08/25
Message-ID: <35da7705.9477858@news.ma.ultranet.com>#1/1
X-Deja-AN: 384609812
X-NNTP-Posting-Host: truffle.ultranet.com
Content-Transfer-Encoding: 7bit
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <6qfr41$oue$1@pigpen.csrlink.net> <35ccc2b4.832003@news3.ibm.net> <6qn19u$sb0$1@pigpen.csrlink.net> <6qnfc9$a0s$1@nnrp1.dejanews.com> <6qovei$5ou$1@shell7.ba.best.com> <fxtu33jl9zt.fsf@isolde.engr.sgi.com> <6qqd2q$bs9$1@nnrp1.dejanews.com> <35dfe616.47271311@news.ma.ultranet.com> <6rlcjt$803$1@nnrp1.dejanews.com>
X-UID: 0000000001
X-Status: $$$$
X-Ultra-Time: 25 Aug 1998 15:41:33 GMT
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@ultra.net
Organization: UltraNet Communications , an RCN Company http://www.ultranet.com/
Mime-Version: 1.0
Newsgroups: comp.std.c++
Originator: clamage@taumet


saroj@bear.com wrote:

>
>substring, replacing substring, concatenation - COW will not help you.
>If at all, it will be worse than non-COW, because most string
>representations are contiguous. 

I didn't mean to imply that any non-const operation is accelerated by
COW.  Rather, the above-mentioned operations do not expose references
into the buffer and thus do not require the modified string buffer to be
marked unshareable (unline non-const operator[], begin() and end()).
This means you can modify a string using these operations and then copy
the result without doing a deep-copy.

-------------------------------------------------------------
Pablo Halpern                   phalpern@truffle.ultranet.com

I am self-employed. Therefore, my opinions *do* represent 
those of my employer.


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




