From stdcxx-commits-return-270-apmail-incubator-stdcxx-commits-archive=incubator.apache.org@incubator.apache.org Mon Jan 02 00:22:53 2006 Return-Path: Delivered-To: apmail-incubator-stdcxx-commits-archive@www.apache.org Received: (qmail 80805 invoked from network); 2 Jan 2006 00:22:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Jan 2006 00:22:53 -0000 Received: (qmail 80676 invoked by uid 500); 2 Jan 2006 00:22:53 -0000 Delivered-To: apmail-incubator-stdcxx-commits-archive@incubator.apache.org Received: (qmail 80658 invoked by uid 500); 2 Jan 2006 00:22:53 -0000 Mailing-List: contact stdcxx-commits-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-commits@incubator.apache.org Received: (qmail 80647 invoked by uid 500); 2 Jan 2006 00:22:53 -0000 Delivered-To: apmail-incubator-stdcxx-cvs@incubator.apache.org Received: (qmail 80644 invoked by uid 99); 2 Jan 2006 00:22:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jan 2006 16:22:52 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 01 Jan 2006 16:22:52 -0800 Received: (qmail 80764 invoked by uid 65534); 2 Jan 2006 00:22:32 -0000 Message-ID: <20060102002232.80763.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r360602 - /incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp Date: Mon, 02 Jan 2006 00:22:31 -0000 To: stdcxx-cvs@incubator.apache.org From: sebor@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sebor Date: Sun Jan 1 16:22:29 2006 New Revision: 360602 URL: http://svn.apache.org/viewcvs?rev=360602&view=rev Log: 2006-01-01 Martin Sebor * 25.lower.bound.cpp (conv_to_bool): Used instead of ConvertibleToBool. (test_lower_bound): Silenced bogus EDG eccp 3.6 remark #550-D: variable was set but never used. Modified: incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp Modified: incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp?rev=360602&r1=360601&r2=360602&view=diff ============================================================================== --- incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp (original) +++ incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp Sun Jan 1 16:22:29 2006 @@ -53,9 +53,10 @@ void operator=(Y&); // not Assignable }; -inline bool operator< (const X &lhs, const Y &rhs) +inline conv_to_bool +operator< (const X &lhs, const Y &rhs) { - return lhs < rhs.xval_; + return conv_to_bool::make (lhs < rhs.xval_); } /**************************************************************************/ @@ -69,18 +70,11 @@ funcalls_ = 0; } - class ConvertibleToBool { - bool result_; - public: - ConvertibleToBool (bool res): result_ (res) { /* empty */ } - operator bool() const { return result_; } - }; - // return a type other than bool but one that is implicitly // convertible to bool to detect incorrect assumptions - ConvertibleToBool operator() (const X &lhs, const Y &rhs) { + conv_to_bool operator() (const X &lhs, const Y &rhs) { ++funcalls_; - return ConvertibleToBool (lhs < rhs.xval_); + return conv_to_bool::make (lhs < rhs.xval_); } private: @@ -131,6 +125,10 @@ const ForwardIterator result = predicate ? std::lower_bound (first, last, value, comp) : std::lower_bound (first, last, value); + + // silence bogus EDG eccp 3.6 remark #550-D: + // variable was set but never used + _RWSTD_UNUSED (result); // verify correctness const std::size_t off = std::size_t (result.cur_ - xsrc);