Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 79464 invoked from network); 18 Jan 2006 01:56:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Jan 2006 01:56:14 -0000 Received: (qmail 34797 invoked by uid 500); 18 Jan 2006 01:56:14 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 34785 invoked by uid 500); 18 Jan 2006 01:56:13 -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 34770 invoked by uid 99); 18 Jan 2006 01:56:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2006 17:56:13 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [12.17.213.84] (HELO bco-exchange.bco.roguewave.com) (12.17.213.84) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2006 17:56:13 -0800 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 ZGW281S6; Tue, 17 Jan 2006 18:49:06 -0700 Message-ID: <43CDA10E.9@roguewave.com> Date: Tue, 17 Jan 2006 18:59:42 -0700 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: test for lig.alg.swap References: <43CD18E5.1010008@moscow.vdiweb.com> In-Reply-To: <43CD18E5.1010008@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: > The attached file contains my attempt to update lib.alg.swap tests and > port them to new test driver. Thanks! Your idea of reducing code duplication is neat. Unfortunately, there is a problem with it that prevents us from taking advantage of it in its current form: the library is designed to handle compilers that do not provide support or fully implement member templates (the configuration macro _RWSTD_NO_MEMBER_TEMPLATES). Thus the testsuite cannot assume that member templates are supported. [...] > // classes used to exercise swap functions and to reduce code lines > struct TestIterSwap > { > TestIterSwap (int dummy) : dummy_(dummy) {} > > template > void test_swap (ForwardIterator1 it1, ForwardIterator2 it2, const T* ) This is the problem. But I think we should be able to deal with it quite easily. We don't need member templates to avoid code duplication -- a simple if (test_swap_ranges) test_swap_ranges (it1, it2, (T*)0); else test_iter_swap (it1, it2, (T*)0, true); in a new simple forwarding function called from the first overload of test_swap() should do, don't you think? Martin