Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 5366 invoked from network); 2 Jun 2006 00:58:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Jun 2006 00:58:17 -0000 Received: (qmail 28482 invoked by uid 500); 2 Jun 2006 00:58:16 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 28457 invoked by uid 500); 2 Jun 2006 00:58:16 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 28441 invoked by uid 99); 2 Jun 2006 00:58:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jun 2006 17:58:16 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [208.30.140.160] (HELO moroha.quovadx.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jun 2006 17:58:14 -0700 Received: from qxvcexch01.ad.quovadx.com ([192.168.170.59]) by moroha.quovadx.com (8.13.4/8.13.4) with ESMTP id k520vVfs027699 for ; Fri, 2 Jun 2006 00:57:31 GMT Received: from [10.70.3.113] ([10.70.3.113]) by qxvcexch01.ad.quovadx.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 1 Jun 2006 18:58:04 -0600 Message-ID: <447F8109.7010009@roguewave.com> Date: Thu, 01 Jun 2006 18:06:33 -0600 From: Martin Sebor Organization: Rogue Wave Software User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 X-Accept-Language: en-us, en MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: lib.string.capacity test update References: <4D6A8407B7AC6F4D95B0E55C4E7C4C62044F623A@exmsk.moscow.vdiweb.com> <447F7A10.2060503@roguewave.com> In-Reply-To: <447F7A10.2060503@roguewave.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 02 Jun 2006 00:58:04.0558 (UTC) FILETIME=[9AA89AE0:01C685DF] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Martin Sebor wrote: [...] > Btw., I'm not sure exactly what other string tests are left but an > enhancement that still needs to be implemented across several of the > tests (ctors, append, erase, insert and replace) is exercising the > exception safety of the member function templates. Since much of the > exception safety code in the range test functions will be the same > as the code in the functions testing the ordinary (non-template) > overloads it would be good to share it to avoid bloat and reduce > maintenance effort. FWIW, to make this possible it might be helpful to use the virtual function approach we successfully applied in some of the algorithms tests. I.e., have a single test function take as an argument a reference of some base class for which the range tests will pass an object of a class template derived from it and specialized on the type of the iterator. E.g., something like this: template struct ReplaceBase { virtual void operator()(std::basic_string<...> &str, /* ... */, const StringTestCaseData&) const { // ... switch (tdata.func.which) { // ... handle all non-template overloads } } }; template struct ReplaceRange: ReplaceBase<...> { virtual void operator()(std::basic_string<...> &str /* ... */, const StringTestCaseData&) const { // ... switch (tdata.func.which) { // ... handle all template overloads } } }; We might want to have multiple overloads of operator() in the base class, one for each overload of the string function. Or, if it would make things simpler, we can have just one and have the caller set up all the arguments just as it does now and simply pass them to the operator. This approach might involve fewer changes. We'll see when we try it. Martin