Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 99566 invoked from network); 9 Jul 2008 18:40:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jul 2008 18:40:20 -0000 Received: (qmail 86188 invoked by uid 500); 9 Jul 2008 18:40:20 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 86171 invoked by uid 500); 9 Jul 2008 18:40:20 -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 86160 invoked by uid 99); 9 Jul 2008 18:40:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2008 11:40:20 -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: local policy) Received: from [208.30.140.160] (HELO moroha.roguewave.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2008 18:39:28 +0000 Received: from exchmail01.Blue.Roguewave.Com (exchmail01.blue.roguewave.com [10.22.129.22]) by moroha.roguewave.com (8.13.6/8.13.6) with ESMTP id m69Idn91029991 for ; Wed, 9 Jul 2008 18:39:49 GMT X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: svn commit: r675044 - in /stdcxx/branches/4.3.x: include/rw/_tuple.h include/tuple tests/utilities/20.tuple.cnstr.cpp tests/utilities/20.tuple.creation.cpp tests/utilities/20.tuple.h tests/utilities/20.tuple.helpers.cpp Date: Wed, 9 Jul 2008 12:39:54 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: svn commit: r675044 - in /stdcxx/branches/4.3.x: include/rw/_tuple.h include/tuple tests/utilities/20.tuple.cnstr.cpp tests/utilities/20.tuple.creation.cpp tests/utilities/20.tuple.h tests/utilities/20.tuple.helpers.cpp Thread-Index: AcjhUHjBx2jJV/psQR+A5lb/aX/PGwAAbPOAACScKSAAAvmE4AAAjzhw References: <20080708231336.C38872388A22@eris.apache.org> From: "Eric Lemings" To: X-Virus-Checked: Checked by ClamAV on apache.org =20 > -----Original Message----- > From: Travis Vitek [mailto:Travis.Vitek@roguewave.com]=20 > Sent: Wednesday, July 09, 2008 12:28 PM > To: dev@stdcxx.apache.org > Subject: RE: svn commit: r675044 - in /stdcxx/branches/4.3.x:=20 > include/rw/_tuple.h include/tuple=20 > tests/utilities/20.tuple.cnstr.cpp=20 > tests/utilities/20.tuple.creation.cpp=20 > tests/utilities/20.tuple.h tests/utilities/20.tuple.helpers.cpp >=20 > =20 >=20 > Eric Lemings wrote: > > > >> Travis Vitek wrote: > >> > >> >Modified:=20 > >stdcxx/branches/4.3.x/tests/utilities/20.tuple.creation.cpp > >... > >> >+ rw_assert (0 =3D=3D std::strcmp (s, "string"), __FILE__,=20 > __LINE__, > >> >+ "s =3D=3D \"string\", got false, expected true"); > >>=20 > >> The tuple is holding the original pointer (not a copy), so I=20 > >think you > >> can check the actual pointer here. > > > >True. But if that assumption became invalid for whatever reason, the > >code above would still work. > > > >Assumptions are bad. Robustness is good. :) >=20 > As I see it, the tuple implementation is required to hold a copy of an > object of the specified type (const char* in this case). If you don't > verify the value held is indeed a copy, you are not actually verifying > the requirements. This is wrong, and wrong is much worse than bad. :) Question: const char* s1 =3D "string"; const char* s2 =3D "string"; // s1 guaranteed to equal s2? Brad.