This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] More std:: qualification work


Hi,

tested x86-linux. Many thanks to Martin Sebor.

Paolo.

/////////
2003-07-04  Paolo Carlini  <pcarlini@unitus.it>

	* include/bits/stl_heap.h: Fully qualify standard
	functions with std::, thus avoiding Koenig lookup.
	* include/bits/stl_iterator_base_funcs.h: Likewise.

	* include/bits/stl_algo.h: Qualify __iterator_category too.
	* include/bits/stl_algobase.h: Likewise.
	* include/bits/stl_bvector.h: Likewise.

	* include/bits/stl_algo.h: Don't qualify the pair type.
diff -urN libstdc++-v3-orig/include/bits/stl_algo.h libstdc++-v3/include/bits/stl_algo.h
--- libstdc++-v3-orig/include/bits/stl_algo.h	2003-06-30 03:46:42.000000000 +0200
+++ libstdc++-v3/include/bits/stl_algo.h	2003-07-03 23:38:15.000000000 +0200
@@ -295,7 +295,7 @@
       __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
       __glibcpp_function_requires(_EqualOpConcept<
 		typename iterator_traits<_InputIterator>::value_type, _Tp>)
-      return std::find(__first, __last, __val, __iterator_category(__first));
+      return std::find(__first, __last, __val, std::__iterator_category(__first));
     }
 
   /**
@@ -315,7 +315,7 @@
       __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
       __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
 	      typename iterator_traits<_InputIterator>::value_type>)
-      return std::find_if(__first, __last, __pred, __iterator_category(__first));
+      return std::find_if(__first, __last, __pred, std::__iterator_category(__first));
     }
 
   /**
@@ -1352,7 +1352,7 @@
 	  // concept requirements
 	  __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<
 		    _BidirectionalIterator>)
-	  std::__reverse(__first, __last, __iterator_category(__first));
+	  std::__reverse(__first, __last, std::__iterator_category(__first));
     }
 
   /**
@@ -1754,7 +1754,7 @@
       __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
 	    typename iterator_traits<_ForwardIterator>::value_type>)
 
-      return std::__partition(__first, __last, __pred, __iterator_category(__first));
+      return std::__partition(__first, __last, __pred, std::__iterator_category(__first));
     }
 
 
@@ -3469,10 +3469,10 @@
 	  __left = std::lower_bound(__first, __middle, __val);
 	  std::advance(__first, __len);
 	  __right = std::upper_bound(++__middle, __first, __val);
-	  return std::pair<_ForwardIterator, _ForwardIterator>(__left, __right);
+	  return pair<_ForwardIterator, _ForwardIterator>(__left, __right);
 	}
       }
-      return std::pair<_ForwardIterator, _ForwardIterator>(__first, __first);
+      return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
     }
 
   /**
@@ -3524,10 +3524,10 @@
 	  __left = std::lower_bound(__first, __middle, __val, __comp);
 	  std::advance(__first, __len);
 	  __right = std::upper_bound(++__middle, __first, __val, __comp);
-	  return std::pair<_ForwardIterator, _ForwardIterator>(__left, __right);
+	  return pair<_ForwardIterator, _ForwardIterator>(__left, __right);
 	}
       }
-      return std::pair<_ForwardIterator, _ForwardIterator>(__first, __first);
+      return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
     }
 
   /**
@@ -4320,8 +4320,8 @@
 	    typename iterator_traits<_ForwardIterator2>::value_type>)
 
       return std::__find_end(__first1, __last1, __first2, __last2,
-			     __iterator_category(__first1),
-			     __iterator_category(__first2));
+			     std::__iterator_category(__first1),
+			     std::__iterator_category(__first2));
     }
 
   template<typename _ForwardIterator1, typename _ForwardIterator2,
@@ -4339,8 +4339,8 @@
 	    typename iterator_traits<_ForwardIterator2>::value_type>)
 
       return std::__find_end(__first1, __last1, __first2, __last2,
-			     __iterator_category(__first1),
-			     __iterator_category(__first2),
+			     std::__iterator_category(__first1),
+			     std::__iterator_category(__first2),
 			     __comp);
     }
 
diff -urN libstdc++-v3-orig/include/bits/stl_algobase.h libstdc++-v3/include/bits/stl_algobase.h
--- libstdc++-v3-orig/include/bits/stl_algobase.h	2003-07-01 00:29:42.000000000 +0200
+++ libstdc++-v3/include/bits/stl_algobase.h	2003-07-03 23:24:00.000000000 +0200
@@ -248,13 +248,13 @@
     inline _OutputIterator
     __copy_aux2(_InputIterator __first, _InputIterator __last,
 		_OutputIterator __result, __false_type)
-    { return std::__copy(__first, __last, __result, __iterator_category(__first)); }
+    { return std::__copy(__first, __last, __result, std::__iterator_category(__first)); }
 
   template<typename _InputIterator, typename _OutputIterator>
     inline _OutputIterator
     __copy_aux2(_InputIterator __first, _InputIterator __last,
 		_OutputIterator __result, __true_type)
-    { return std::__copy(__first, __last, __result, __iterator_category(__first)); }
+    { return std::__copy(__first, __last, __result, std::__iterator_category(__first)); }
 
   template<typename _Tp>
     inline _Tp*
@@ -370,7 +370,7 @@
 	   _BidirectionalIterator2 __result)
       {
         return std::__copy_backward(__first, __last, __result, 
-				    __iterator_category(__first));
+				    std::__iterator_category(__first));
       }
     };
 
@@ -594,7 +594,7 @@
 	  ++__first1;
 	  ++__first2;
         }
-      return std::pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+      return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
     }
 
   /**
@@ -625,7 +625,7 @@
 	  ++__first1;
 	  ++__first2;
         }
-      return std::pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+      return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
     }
 
   /**
diff -urN libstdc++-v3-orig/include/bits/stl_bvector.h libstdc++-v3/include/bits/stl_bvector.h
--- libstdc++-v3-orig/include/bits/stl_bvector.h	2003-07-02 12:37:33.000000000 +0200
+++ libstdc++-v3/include/bits/stl_bvector.h	2003-07-03 23:22:11.000000000 +0200
@@ -522,7 +522,7 @@
     template <class _InputIterator>
     void _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
                                 __false_type) {
-      _M_initialize_range(__first, __last, __iterator_category(__first));
+      _M_initialize_range(__first, __last, std::__iterator_category(__first));
     }
   
     template <class _InputIterator>
@@ -577,7 +577,7 @@
   
     template <class _InputIterator>
     void _M_assign_dispatch(_InputIterator __first, _InputIterator __last, __false_type)
-      { _M_assign_aux(__first, __last, __iterator_category(__first)); }
+      { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
   
     template <class _InputIterator>
     void _M_assign_aux(_InputIterator __first, _InputIterator __last,
@@ -662,7 +662,7 @@
     void _M_insert_dispatch(iterator __pos,
                             _InputIterator __first, _InputIterator __last,
                             __false_type) {
-      _M_insert_range(__pos, __first, __last, __iterator_category(__first));
+      _M_insert_range(__pos, __first, __last, std::__iterator_category(__first));
     }
   
     template <class _InputIterator>
diff -urN libstdc++-v3-orig/include/bits/stl_heap.h libstdc++-v3/include/bits/stl_heap.h
--- libstdc++-v3-orig/include/bits/stl_heap.h	2001-11-02 18:38:11.000000000 +0100
+++ libstdc++-v3/include/bits/stl_heap.h	2003-07-03 18:11:54.000000000 +0200
@@ -93,8 +93,8 @@
 	    _RandomAccessIterator>)
       __glibcpp_function_requires(_LessThanComparableConcept<_ValueType>)
 
-      __push_heap(__first, _DistanceType((__last - __first) - 1), _DistanceType(0), 
-		  _ValueType(*(__last - 1)));
+      std::__push_heap(__first, _DistanceType((__last - __first) - 1), _DistanceType(0), 
+		       _ValueType(*(__last - 1)));
     }
 
   template<typename _RandomAccessIterator, typename _Distance, typename _Tp, 
@@ -126,8 +126,8 @@
       __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
 	    _RandomAccessIterator>)
 
-      __push_heap(__first, _DistanceType((__last - __first) - 1), _DistanceType(0), 
-		  _ValueType(*(__last - 1)), __comp);
+      std::__push_heap(__first, _DistanceType((__last - __first) - 1), _DistanceType(0), 
+		       _ValueType(*(__last - 1)), __comp);
     }
 
   template<typename _RandomAccessIterator, typename _Distance, typename _Tp>
@@ -148,7 +148,7 @@
 	*(__first + __holeIndex) = *(__first + (__secondChild - 1));
 	__holeIndex = __secondChild - 1;
       }
-      __push_heap(__first, __holeIndex, __topIndex, __value);
+      std::__push_heap(__first, __holeIndex, __topIndex, __value);
     }
 
   template<typename _RandomAccessIterator, typename _Tp>
@@ -158,7 +158,7 @@
     {
       typedef typename iterator_traits<_RandomAccessIterator>::difference_type _Distance;
       *__result = *__first;
-      __adjust_heap(__first, _Distance(0), _Distance(__last - __first), __value);
+      std::__adjust_heap(__first, _Distance(0), _Distance(__last - __first), __value);
     }
 
   template<typename _RandomAccessIterator>
@@ -172,7 +172,7 @@
 	    _RandomAccessIterator>)
       __glibcpp_function_requires(_LessThanComparableConcept<_ValueType>)
 
-      __pop_heap(__first, __last - 1, __last - 1, _ValueType(*(__last - 1)));
+      std::__pop_heap(__first, __last - 1, __last - 1, _ValueType(*(__last - 1)));
     }
 
   template<typename _RandomAccessIterator, typename _Distance,
@@ -194,7 +194,7 @@
 	*(__first + __holeIndex) = *(__first + (__secondChild - 1));
 	__holeIndex = __secondChild - 1;
       }
-      __push_heap(__first, __holeIndex, __topIndex, __value, __comp);
+      std::__push_heap(__first, __holeIndex, __topIndex, __value, __comp);
     }
 
   template<typename _RandomAccessIterator, typename _Tp, typename _Compare>
@@ -204,8 +204,8 @@
     {
       typedef typename iterator_traits<_RandomAccessIterator>::difference_type _Distance;
       *__result = *__first;
-      __adjust_heap(__first, _Distance(0), _Distance(__last - __first), 
-		    __value, __comp);
+      std::__adjust_heap(__first, _Distance(0), _Distance(__last - __first), 
+			 __value, __comp);
     }
 
   template<typename _RandomAccessIterator, typename _Compare>
@@ -218,7 +218,7 @@
 	    _RandomAccessIterator>)
 
       typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
-      __pop_heap(__first, __last - 1, __last - 1, _ValueType(*(__last - 1)), __comp);
+      std::__pop_heap(__first, __last - 1, __last - 1, _ValueType(*(__last - 1)), __comp);
     }
 
   template<typename _RandomAccessIterator>
@@ -240,7 +240,7 @@
       _DistanceType __parent = (__len - 2)/2;
 	
       while (true) {
-	__adjust_heap(__first, __parent, __len, _ValueType(*(__first + __parent)));
+	std::__adjust_heap(__first, __parent, __len, _ValueType(*(__first + __parent)));
 	if (__parent == 0) return;
 	__parent--;
       }
@@ -265,8 +265,8 @@
       _DistanceType __parent = (__len - 2)/2;
 	
       while (true) {
-	__adjust_heap(__first, __parent, __len,
-	              _ValueType(*(__first + __parent)), __comp);
+	std::__adjust_heap(__first, __parent, __len,
+			   _ValueType(*(__first + __parent)), __comp);
 	if (__parent == 0) return;
 	__parent--;
       }
@@ -283,7 +283,7 @@
 	    typename iterator_traits<_RandomAccessIterator>::value_type>)
 
       while (__last - __first > 1)
-	pop_heap(__first, __last--);
+	std::pop_heap(__first, __last--);
     }
 
   template<typename _RandomAccessIterator, typename _Compare>
@@ -296,7 +296,7 @@
 	    _RandomAccessIterator>)
 
       while (__last - __first > 1)
-	pop_heap(__first, __last--, __comp);
+	std::pop_heap(__first, __last--, __comp);
     }
 
 } // namespace std
diff -urN libstdc++-v3-orig/include/bits/stl_iterator_base_funcs.h libstdc++-v3/include/bits/stl_iterator_base_funcs.h
--- libstdc++-v3-orig/include/bits/stl_iterator_base_funcs.h	2003-06-10 23:52:23.000000000 +0200
+++ libstdc++-v3/include/bits/stl_iterator_base_funcs.h	2003-07-03 23:20:41.000000000 +0200
@@ -1,6 +1,6 @@
 // Functions used by iterators -*- C++ -*-
 
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -111,7 +111,7 @@
     distance(_InputIterator __first, _InputIterator __last)
     {
       // concept requirements -- taken care of in __distance
-      return __distance(__first, __last, __iterator_category(__first));
+      return std::__distance(__first, __last, std::__iterator_category(__first));
     }
   
   template<typename _InputIterator, typename _Distance>
@@ -164,7 +164,7 @@
     advance(_InputIterator& __i, _Distance __n)
     {
       // concept requirements -- taken care of in __advance
-      __advance(__i, __n, __iterator_category(__i));
+      std::__advance(__i, __n, std::__iterator_category(__i));
     }
 } // namespace std
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]