OSDN Git Service

2007-11-25 Paolo Carlini <pcarlini@suse.de>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 25 Nov 2007 11:22:03 +0000 (11:22 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 25 Nov 2007 11:22:03 +0000 (11:22 +0000)
* include/bits/stl_algobase.h (__lexicographical_compare<>::__lc):
Move out of line.

* include/bits/stl_algobase.h (swap_ranges): Remove redundant
simulated concept checks.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130404 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_algobase.h

index 635bb1e..91aba14 100644 (file)
@@ -1,3 +1,11 @@
+2007-11-25  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/bits/stl_algobase.h (__lexicographical_compare<>::__lc):
+       Move out of line.
+
+       * include/bits/stl_algobase.h (swap_ranges): Remove redundant
+       simulated concept checks.
+
 2007-11-23  Paolo Carlini  <pcarlini@suse.de>
 
        * include/std/bitset (bitset<>::all): Add, per DR 693 [Ready].
index 32dfacd..52f2ca4 100644 (file)
@@ -166,12 +166,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                                  _ForwardIterator1>)
       __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
                                  _ForwardIterator2>)
-      __glibcxx_function_requires(_ConvertibleConcept<
-           typename iterator_traits<_ForwardIterator1>::value_type,
-           typename iterator_traits<_ForwardIterator2>::value_type>)
-      __glibcxx_function_requires(_ConvertibleConcept<
-           typename iterator_traits<_ForwardIterator2>::value_type,
-           typename iterator_traits<_ForwardIterator1>::value_type>)
       __glibcxx_requires_valid_range(__first1, __last1);
 
       for (; __first1 != __last1; ++__first1, ++__first2)
@@ -819,27 +813,32 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     struct __lexicographical_compare
     {
       template<typename _II1, typename _II2>
-        static bool
-        __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
-        {
-         typedef typename iterator_traits<_II1>::iterator_category _Category1;
-         typedef typename iterator_traits<_II2>::iterator_category _Category2;
-         typedef std::__lc_rai<_Category1, _Category2>         __rai_type;
-
-         __last1 = __rai_type::__newlast1(__first1, __last1,
-                                          __first2, __last2);
-         for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
-              ++__first1, ++__first2)
-           {
-             if (*__first1 < *__first2)
-               return true;
-             if (*__first2 < *__first1)
-               return false;
-           }
-         return __first1 == __last1 && __first2 != __last2;
-       }
+        static bool __lc(_II1, _II1, _II2, _II2);
     };
 
+  template<bool _BoolType>
+    template<typename _II1, typename _II2>
+      bool
+      __lexicographical_compare<_BoolType>::
+      __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
+      {
+       typedef typename iterator_traits<_II1>::iterator_category _Category1;
+       typedef typename iterator_traits<_II2>::iterator_category _Category2;
+       typedef std::__lc_rai<_Category1, _Category2>   __rai_type;
+       
+       __last1 = __rai_type::__newlast1(__first1, __last1,
+                                        __first2, __last2);
+       for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
+            ++__first1, ++__first2)
+         {
+           if (*__first1 < *__first2)
+             return true;
+           if (*__first2 < *__first1)
+             return false;
+         }
+       return __first1 == __last1 && __first2 != __last2;
+      }
+
   template<>
     struct __lexicographical_compare<true>
     {