From stdcxx-dev-return-1262-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Wed May 03 16:18:13 2006 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 77672 invoked from network); 3 May 2006 16:18:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 May 2006 16:18:12 -0000 Received: (qmail 8192 invoked by uid 500); 3 May 2006 16:18:11 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 8177 invoked by uid 500); 3 May 2006 16:18:11 -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 8166 invoked by uid 99); 3 May 2006 16:18:11 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 May 2006 09:18:11 -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; Wed, 03 May 2006 09:18:10 -0700 Received: from bco-exchange.bco.roguewave.com (bco-exchange.bco.roguewave.com [172.19.31.48]) by moroha.quovadx.com (8.13.4/8.13.4) with ESMTP id k43GHT4M015734 for ; Wed, 3 May 2006 16:17:30 GMT Received: from [10.70.3.113] (10.70.3.113 [10.70.3.113]) by bco-exchange.bco.roguewave.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id 2YG6D07M; Wed, 3 May 2006 10:14:21 -0600 Message-ID: <4458D7C3.5040407@roguewave.com> Date: Wed, 03 May 2006 10:18:11 -0600 From: Martin Sebor 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: Tests for lib.string::find methods References: <4D6A8407B7AC6F4D95B0E55C4E7C4C620423D23B@exmsk.moscow.vdiweb.com> In-Reply-To: <4D6A8407B7AC6F4D95B0E55C4E7C4C620423D23B@exmsk.moscow.vdiweb.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Anton Pevtsov wrote: [...] > Martin Sebor wrote: > >>I don't think it's incorrect since compare() must be implemented as if > > by calling eq(), although the standard should probably not mandate > one > or the other. The way it's done in our implementation, however, is > probably going to be extremely inefficient. There are much better > > algorithms than this naive method. We need an issue for the efficiency > side of things at the very least (I suspect the efficient algorithm > > will end up using eq() directly). > > I found that our compare implementation uses memcmp and doesn't call > eq(). > Maybe it will be useful to open a jira issue about that? The use of memcmp() is okay for std::string (and wmemcmp() for std::wstring) since it's not detectable by a conforming program what those specializations of basic_string use "under the hood." All other specializations of basic_string must behave as specified since their behavior is detectable (e.g., by supplying a user defined traits class). So I agree that we should probably have an issue tracking the fact that our compare() fails to use traits::eq(), even though it's IMO a QoI issue whether we use it or traits::compare(). Martin