Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 24228 invoked from network); 13 Jun 2008 16:12:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jun 2008 16:12:41 -0000 Received: (qmail 36923 invoked by uid 500); 13 Jun 2008 16:12:43 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 36909 invoked by uid 500); 13 Jun 2008 16:12:43 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 36898 invoked by uid 99); 13 Jun 2008 16:12:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jun 2008 09:12:43 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of msebor@gmail.com designates 72.14.220.157 as permitted sender) Received: from [72.14.220.157] (HELO fg-out-1718.google.com) (72.14.220.157) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jun 2008 16:11:53 +0000 Received: by fg-out-1718.google.com with SMTP id 16so3108785fgg.23 for ; Fri, 13 Jun 2008 09:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type:sender; bh=i9LmhGVf9IeAXDFPeuRwiQamWGgUYIv9H88fggx4r34=; b=f0fyOqBN2Viw5jbcfCWXXa8rAori8KfJYARt72Lc7HHXjO/xXsJ5xjwv2PduP4BGfz LuMufG0PftoKcRSXATqdm2ZQOk/lZ3Pw9p08jQWpVSzXMuU9q37A0oY3yOF467/qATkj mwklVglMrnVdxbh8p6BBnu9/iIALZzUArQwAM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:sender; b=xYN52CHnY8eQdH87IK26XbE4cSIaaqR/XMrklOm8U8pQbya0fFOQXBhuflkjCC9tSW 5VOjpfGmq3v+zxSWJq51z1dCir36UsC9HvcHRcIRbgErannGCW1Ayno2IMb1Aji2aUJr pBaVg/XfRlYqkA19jlMJqsrf3GK73n49HZGMk= Received: by 10.86.80.17 with SMTP id d17mr4240734fgb.24.1213373527470; Fri, 13 Jun 2008 09:12:07 -0700 (PDT) Received: from ?194.254.174.206? ( [194.254.174.206]) by mx.google.com with ESMTPS id d4sm5393933fga.8.2008.06.13.09.12.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 13 Jun 2008 09:12:06 -0700 (PDT) Message-ID: <48529C54.5090408@roguewave.com> Date: Fri, 13 Jun 2008 09:12:04 -0700 From: Martin Sebor User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: dev@stdcxx.apache.org Subject: string cow bug ([Fwd: Fwd: Update: string COW]) Content-Type: multipart/mixed; boundary="------------020207050709040808040305" Sender: Martin Sebor X-Virus-Checked: Checked by ClamAV on apache.org --------------020207050709040808040305 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 7bit ...attached is a test case I got from a fellow attendee of my meeting for what at first blush looks like a COW bug in stdcxx string. The expected output on line 4 is: 2. cc1: 'H' Martin --------------020207050709040808040305 Content-Type: text/x-c++src; name="string-cow.cpp" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="string-cow.cpp" #include #include int main() { std::string s1("hello"); std::string const& cs1 = s1; std::string const cs2(s1); char const& cc1 = cs1[0]; char const& cc2 = cs2[0]; std::cout << "1: cs1[0]: '" << cs1[0] << "' / " << static_cast(&cs1[0]) << "\n"; std::cout << "1: cc1: '" << cc1 << "' / " << static_cast(&cc1) << "\n"; s1[0] = 'H'; std::cout << "2: cs1[0]: '" << cs1[0] << "' / " << static_cast(&cs1[0]) << "\n"; std::cout << "2: cc1: '" << cc1 << "' / " << static_cast(&cc1) << "\n"; std::cout << "2: cc2: '" << cc2 << "' / " << static_cast(&cc2) << "\n"; } --------------020207050709040808040305--