You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2005/12/31 02:14:39 UTC

svn commit: r360214 - /incubator/stdcxx/trunk/include/rw/_algobase.h

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  <se...@roguewave.com>

	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 <class _TypeT, class _TypeU>
+    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 <class _TypeT>
 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 <class _TypeT>
 __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