Return-Path: Delivered-To: apmail-incubator-stdcxx-commits-archive@www.apache.org Received: (qmail 43479 invoked from network); 31 Dec 2005 01:15:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Dec 2005 01:15:01 -0000 Received: (qmail 66055 invoked by uid 500); 31 Dec 2005 01:15:01 -0000 Delivered-To: apmail-incubator-stdcxx-commits-archive@incubator.apache.org Received: (qmail 66028 invoked by uid 500); 31 Dec 2005 01:15:00 -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 66017 invoked by uid 500); 31 Dec 2005 01:15:00 -0000 Delivered-To: apmail-incubator-stdcxx-cvs@incubator.apache.org Received: (qmail 66013 invoked by uid 99); 31 Dec 2005 01:15:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Dec 2005 17:15:00 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,UPPERCASE_25_50 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; Fri, 30 Dec 2005 17:15:00 -0800 Received: (qmail 43292 invoked by uid 65534); 31 Dec 2005 01:14:39 -0000 Message-ID: <20051231011439.43290.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r360214 - /incubator/stdcxx/trunk/include/rw/_algobase.h Date: Sat, 31 Dec 2005 01:14:39 -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: Fri Dec 30 17:14:36 2005 New Revision: 360214 URL: http://svn.apache.org/viewcvs?rev=360214&view=rev Log: 2005-12-30 Martin Sebor STDCXX-89 * _algobase.h [!_RWSTD_NO_INLINE_MEMBER_TEMPLATES] (__rw_lt): Changed from a template class with an ordinary member operator() to an ordinary class with a template member operator() to permit the comparison of arguments of heterogeneous types. Modified: incubator/stdcxx/trunk/include/rw/_algobase.h Modified: incubator/stdcxx/trunk/include/rw/_algobase.h URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/rw/_algobase.h?rev=360214&r1=360213&r2=360214&view=diff ============================================================================== --- incubator/stdcxx/trunk/include/rw/_algobase.h (original) +++ incubator/stdcxx/trunk/include/rw/_algobase.h Fri Dec 30 17:14:36 2005 @@ -128,9 +128,24 @@ } // namespace std -_RWSTD_NAMESPACE (__rw) { +_RWSTD_NAMESPACE (__rw) { + +#ifndef _RWSTD_NO_INLINE_MEMBER_TEMPLATES + +// `less than' function object - used by non-predicate forms +// of algorithms to invoke the predicate forms for code reuse +struct __rw_lt +{ + template + bool operator() (_TypeT &__lhs, _TypeU &__rhs) const { + return __lhs < __rhs; + } +}; + +# define _RWSTD_LESS(ignore) _RW::__rw_lt () + +#else // if defined (_RWSTD_NO_INLINE_MEMBER_TEMPLATES) -// `less than' qusi-function object - used by algorithms for code reuse template struct __rw_lt { @@ -139,15 +154,15 @@ } }; -#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC +# ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC -# define _RWSTD_LESS(iterT) \ - _RW::__rw_lt<_TYPENAME _STD::iterator_traits< iterT >::value_type>() +# define _RWSTD_LESS(iterT) \ + _RW::__rw_lt<_TYPENAME _STD::iterator_traits< iterT >::value_type>() -#else // if defined (_RWSTD_NO_PARTIAL_CLASS_SPEC) +# else // if defined (_RWSTD_NO_PARTIAL_CLASS_SPEC) -# define _RWSTD_LESS(iterT) \ - _RW::__rw_make_lt (_RWSTD_VALUE_TYPE (iterT)) +# define _RWSTD_LESS(iterT) \ + _RW::__rw_make_lt (_RWSTD_VALUE_TYPE (iterT)) template __rw_lt<_TypeT> __rw_make_lt (const _TypeT*) @@ -155,7 +170,8 @@ return __rw_lt<_TypeT>(); } -#endif // _RWSTD_NO_PARTIAL_CLASS_SPEC +# endif // _RWSTD_NO_PARTIAL_CLASS_SPEC +#endif // _RWSTD_NO_INLINE_MEMBER_TEMPLATES // swaps values of 2 (possibly distinct) types