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] Further std:: qualification work


Hi,

tested x86-linux.

Paolo.

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

	* include/bits/stl_list.h: Fully qualify standard
	functions with std::, thus avoiding Koenig lookup.
	* include/bits/stl_queue.h: Likewise.
	* include/bits/stl_raw_storage_iter.h: Likewise.
	* include/bits/stl_tempbuf.h: Likewise.
	* include/bits/stl_tree.h: Likewise.
	* include/bits/stl_uninitialized.h: Likewise.
	* include/bits/stl_vector.h: Likewise.
	* include/ext/rope: Change includes order.	

diff -urN libstdc++-v3-orig/include/bits/stl_list.h libstdc++-v3/include/bits/stl_list.h
--- libstdc++-v3-orig/include/bits/stl_list.h	2003-06-10 23:52:23.000000000 +0200
+++ libstdc++-v3/include/bits/stl_list.h	2003-07-04 12:55:05.000000000 +0200
@@ -410,7 +410,7 @@
     {
       _Node* __p = _M_get_node();
       try {
-        _Construct(&__p->_M_data, __x);
+        std::_Construct(&__p->_M_data, __x);
       }
       catch(...)
       {
@@ -431,7 +431,7 @@
     {
       _Node* __p = _M_get_node();
       try {
-        _Construct(&__p->_M_data);
+        std::_Construct(&__p->_M_data);
       }
       catch(...)
       {
@@ -1073,8 +1073,8 @@
     inline bool
     operator<(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
     {
-      return lexicographical_compare(__x.begin(), __x.end(),
-                                     __y.begin(), __y.end());
+      return std::lexicographical_compare(__x.begin(), __x.end(),
+					  __y.begin(), __y.end());
     }
   
   /// Based on operator==
diff -urN libstdc++-v3-orig/include/bits/stl_queue.h libstdc++-v3/include/bits/stl_queue.h
--- libstdc++-v3-orig/include/bits/stl_queue.h	2002-12-23 18:36:24.000000000 +0100
+++ libstdc++-v3/include/bits/stl_queue.h	2003-07-04 13:01:13.000000000 +0200
@@ -1,6 +1,6 @@
 // Queue implementation -*- 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
@@ -332,7 +332,7 @@
     priority_queue(const _Compare& __x = _Compare(),
                    const _Sequence& __s = _Sequence()) 
     : c(__s), comp(__x) 
-    { make_heap(c.begin(), c.end(), comp); }
+    { std::make_heap(c.begin(), c.end(), comp); }
   
     /**
      *  @brief  Builds a %queue from a range.
@@ -355,7 +355,7 @@
       : c(__s), comp(__x)
       { 
         c.insert(c.end(), __first, __last);
-        make_heap(c.begin(), c.end(), comp);
+        std::make_heap(c.begin(), c.end(), comp);
       }
   
     /**
@@ -389,7 +389,7 @@
       try 
         {
           c.push_back(__x); 
-          push_heap(c.begin(), c.end(), comp);
+          std::push_heap(c.begin(), c.end(), comp);
         }
       catch(...)
         {
@@ -413,7 +413,7 @@
     {
       try 
         {
-          pop_heap(c.begin(), c.end(), comp);
+          std::pop_heap(c.begin(), c.end(), comp);
           c.pop_back();
         }
       catch(...)
diff -urN libstdc++-v3-orig/include/bits/stl_raw_storage_iter.h libstdc++-v3/include/bits/stl_raw_storage_iter.h
--- libstdc++-v3-orig/include/bits/stl_raw_storage_iter.h	2001-12-19 22:57:42.000000000 +0100
+++ libstdc++-v3/include/bits/stl_raw_storage_iter.h	2003-07-04 13:01:36.000000000 +0200
@@ -84,7 +84,7 @@
       raw_storage_iterator& 
       operator=(const _Tp& __element) 
       {
-	_Construct(&*_M_iter, __element);
+	std::_Construct(&*_M_iter, __element);
 	return *this;
       }        
 
diff -urN libstdc++-v3-orig/include/bits/stl_tempbuf.h libstdc++-v3/include/bits/stl_tempbuf.h
--- libstdc++-v3-orig/include/bits/stl_tempbuf.h	2002-12-16 19:22:59.000000000 +0100
+++ libstdc++-v3/include/bits/stl_tempbuf.h	2003-07-04 13:03:54.000000000 +0200
@@ -99,7 +99,7 @@
 
   void _M_initialize_buffer(const _Tp&, __true_type) {}
   void _M_initialize_buffer(const _Tp& val, __false_type) {
-    uninitialized_fill_n(_M_buffer, _M_len, val);
+    std::uninitialized_fill_n(_M_buffer, _M_len, val);
   }
 
 public:
@@ -133,7 +133,7 @@
   }
  
   ~_Temporary_buffer() {  
-    _Destroy(_M_buffer, _M_buffer + _M_len);
+    std::_Destroy(_M_buffer, _M_buffer + _M_len);
     free(_M_buffer);
   }
 
diff -urN libstdc++-v3-orig/include/bits/stl_tree.h libstdc++-v3/include/bits/stl_tree.h
--- libstdc++-v3-orig/include/bits/stl_tree.h	2003-06-11 17:52:09.000000000 +0200
+++ libstdc++-v3/include/bits/stl_tree.h	2003-07-04 13:05:15.000000000 +0200
@@ -615,7 +615,7 @@
       {
 	_Link_type __tmp = _M_get_node();
 	try 
-	  { _Construct(&__tmp->_M_value_field, __x); }
+	  { std::_Construct(&__tmp->_M_value_field, __x); }
 	catch(...)
 	  {
 	  _M_put_node(__tmp);
@@ -637,7 +637,7 @@
       void
       destroy_node(_Link_type __p)
       {
-	_Destroy(&__p->_M_value_field);
+	std::_Destroy(&__p->_M_value_field);
 	_M_put_node(__p);
       }
 
diff -urN libstdc++-v3-orig/include/bits/stl_uninitialized.h libstdc++-v3/include/bits/stl_uninitialized.h
--- libstdc++-v3-orig/include/bits/stl_uninitialized.h	2003-06-10 23:52:23.000000000 +0200
+++ libstdc++-v3/include/bits/stl_uninitialized.h	2003-07-04 13:08:35.000000000 +0200
@@ -73,7 +73,7 @@
     __uninitialized_copy_aux(_InputIterator __first, _InputIterator __last,
 			     _ForwardIterator __result,
 			     __true_type)
-    { return copy(__first, __last, __result); }
+    { return std::copy(__first, __last, __result); }
 
   template<typename _InputIterator, typename _ForwardIterator>
     _ForwardIterator 
@@ -84,12 +84,12 @@
       _ForwardIterator __cur = __result;
       try {
 	for ( ; __first != __last; ++__first, ++__cur)
-	  _Construct(&*__cur, *__first);
+	  std::_Construct(&*__cur, *__first);
 	return __cur;
       }
       catch(...)
 	{
-	  _Destroy(__result, __cur);
+	  std::_Destroy(__result, __cur);
 	  __throw_exception_again; 
 	}
     }
@@ -109,13 +109,13 @@
     {
       typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
       typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD;
-      return __uninitialized_copy_aux(__first, __last, __result, _Is_POD());
+      return std::__uninitialized_copy_aux(__first, __last, __result, _Is_POD());
     }
 
   inline char*
   uninitialized_copy(const char* __first, const char* __last, char* __result)
   {
-    memmove(__result, __first, __last - __first);
+    std::memmove(__result, __first, __last - __first);
     return __result + (__last - __first);
   }
 
@@ -123,7 +123,7 @@
   uninitialized_copy(const wchar_t* __first, const wchar_t* __last,
 		     wchar_t* __result)
   {
-    memmove(__result, __first, sizeof(wchar_t) * (__last - __first));
+    std::memmove(__result, __first, sizeof(wchar_t) * (__last - __first));
     return __result + (__last - __first);
   }
 
@@ -133,7 +133,7 @@
     inline void
     __uninitialized_fill_aux(_ForwardIterator __first, _ForwardIterator __last, 
 			     const _Tp& __x, __true_type)
-    { fill(__first, __last, __x); }
+    { std::fill(__first, __last, __x); }
 
   template<typename _ForwardIterator, typename _Tp>
     void
@@ -143,11 +143,11 @@
       _ForwardIterator __cur = __first;
       try {
 	for ( ; __cur != __last; ++__cur)
-	  _Construct(&*__cur, __x);
+	  std::_Construct(&*__cur, __x);
       }
       catch(...)
 	{
-	  _Destroy(__first, __cur);
+	  std::_Destroy(__first, __cur);
 	  __throw_exception_again; 
 	}
     }
@@ -167,7 +167,7 @@
     {
       typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
       typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD;
-      __uninitialized_fill_aux(__first, __last, __x, _Is_POD());
+      std::__uninitialized_fill_aux(__first, __last, __x, _Is_POD());
     }
 
   // Valid if copy construction is equivalent to assignment, and if the
@@ -177,7 +177,7 @@
     __uninitialized_fill_n_aux(_ForwardIterator __first, _Size __n,
 			       const _Tp& __x, __true_type)
     {
-      return fill_n(__first, __n, __x);
+      return std::fill_n(__first, __n, __x);
     }
 
   template<typename _ForwardIterator, typename _Size, typename _Tp>
@@ -188,12 +188,12 @@
       _ForwardIterator __cur = __first;
       try {
 	for ( ; __n > 0; --__n, ++__cur)
-	  _Construct(&*__cur, __x);
+	  std::_Construct(&*__cur, __x);
 	return __cur;
       }
       catch(...)
 	{ 
-	  _Destroy(__first, __cur);
+	  std::_Destroy(__first, __cur);
 	  __throw_exception_again; 
 	}
     }
@@ -213,7 +213,7 @@
     {
       typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
       typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD;
-      return __uninitialized_fill_n_aux(__first, __n, __x, _Is_POD());
+      return std::__uninitialized_fill_n_aux(__first, __n, __x, _Is_POD());
     }
 
   // Extensions: __uninitialized_copy_copy, __uninitialized_copy_fill, 
@@ -230,13 +230,13 @@
 			      _InputIterator2 __first2, _InputIterator2 __last2,
 			      _ForwardIterator __result)
     {
-      _ForwardIterator __mid = uninitialized_copy(__first1, __last1, __result);
+      _ForwardIterator __mid = std::uninitialized_copy(__first1, __last1, __result);
       try {
-	return uninitialized_copy(__first2, __last2, __mid);
+	return std::uninitialized_copy(__first2, __last2, __mid);
       }
       catch(...)
 	{ 
-	  _Destroy(__result, __mid);
+	  std::_Destroy(__result, __mid);
 	  __throw_exception_again; 
 	}
     }
@@ -250,13 +250,13 @@
 			      const _Tp& __x,
 			      _InputIterator __first, _InputIterator __last)
     {
-      uninitialized_fill(__result, __mid, __x);
+      std::uninitialized_fill(__result, __mid, __x);
       try {
-	return uninitialized_copy(__first, __last, __mid);
+	return std::uninitialized_copy(__first, __last, __mid);
       }
       catch(...)
 	{
-	  _Destroy(__result, __mid);
+	  std::_Destroy(__result, __mid);
 	  __throw_exception_again; 
 	}
     }
@@ -270,13 +270,13 @@
 			      _ForwardIterator __first2, _ForwardIterator __last2,
 			      const _Tp& __x)
     {
-      _ForwardIterator __mid2 = uninitialized_copy(__first1, __last1, __first2);
+      _ForwardIterator __mid2 = std::uninitialized_copy(__first1, __last1, __first2);
       try {
-	uninitialized_fill(__mid2, __last2, __x);
+	std::uninitialized_fill(__mid2, __last2, __x);
       }
       catch(...)
 	{
-	  _Destroy(__first2, __mid2);
+	  std::_Destroy(__first2, __mid2);
 	  __throw_exception_again; 
 	}
     }
diff -urN libstdc++-v3-orig/include/bits/stl_vector.h libstdc++-v3/include/bits/stl_vector.h
--- libstdc++-v3-orig/include/bits/stl_vector.h	2003-06-10 23:52:23.000000000 +0200
+++ libstdc++-v3/include/bits/stl_vector.h	2003-07-04 13:12:42.000000000 +0200
@@ -239,7 +239,7 @@
       vector(size_type __n, const value_type& __value,
 	     const allocator_type& __a = allocator_type())
       : _Base(__n, __a)
-      { this->_M_finish = uninitialized_fill_n(this->_M_start, __n, __value); }
+      { this->_M_finish = std::uninitialized_fill_n(this->_M_start, __n, __value); }
   
       /**
        *  @brief  Create a %vector with default elements.
@@ -251,8 +251,8 @@
       explicit
       vector(size_type __n)
       : _Base(__n, allocator_type())
-      { this->_M_finish = uninitialized_fill_n(this->_M_start,
-					       __n, value_type()); }
+      { this->_M_finish = std::uninitialized_fill_n(this->_M_start,
+						    __n, value_type()); }
       
       /**
        *  @brief  %Vector copy constructor.
@@ -265,8 +265,8 @@
        */
       vector(const vector& __x)
       : _Base(__x.size(), __x.get_allocator())
-      { this->_M_finish = uninitialized_copy(__x.begin(), __x.end(),
-					     this->_M_start);
+      { this->_M_finish = std::uninitialized_copy(__x.begin(), __x.end(),
+						  this->_M_start);
       }
   
       /**
@@ -298,7 +298,7 @@
        *  themselves are pointers, the pointed-to memory is not touched in any
        *  way.  Managing the pointer is the user's responsibilty.
        */
-      ~vector() { _Destroy(this->_M_start, this->_M_finish); }
+      ~vector() { std::_Destroy(this->_M_start, this->_M_finish); }
   
       /**
        *  @brief  %Vector assignment operator.
@@ -600,7 +600,7 @@
       {
 	if (this->_M_finish != this->_M_end_of_storage)
 	  {
-	    _Construct(this->_M_finish, __x);
+	    std::_Construct(this->_M_finish, __x);
 	    ++this->_M_finish;
 	  }
 	else
@@ -619,7 +619,7 @@
       pop_back()
       {
 	--this->_M_finish;
-	_Destroy(this->_M_finish);
+	std::_Destroy(this->_M_finish);
       }
       
       /**
@@ -756,7 +756,7 @@
 	  pointer __result = _M_allocate(__n);
 	  try
 	    {
-	      uninitialized_copy(__first, __last, __result);
+	      std::uninitialized_copy(__first, __last, __result);
 	      return __result;
 	    }
 	  catch(...)
@@ -776,7 +776,7 @@
         {
 	  this->_M_start = _M_allocate(__n);
 	  this->_M_end_of_storage = this->_M_start + __n;
-	  this->_M_finish = uninitialized_fill_n(this->_M_start, __n, __value);
+	  this->_M_finish = std::uninitialized_fill_n(this->_M_start, __n, __value);
 	}
       
       // Called by the range constructor to implement [23.1.1]/9
@@ -809,8 +809,8 @@
 	  size_type __n = std::distance(__first, __last);
 	  this->_M_start = _M_allocate(__n);
 	  this->_M_end_of_storage = this->_M_start + __n;
-	  this->_M_finish = uninitialized_copy(__first, __last,
-					       this->_M_start);
+	  this->_M_finish = std::uninitialized_copy(__first, __last,
+						    this->_M_start);
 	}
       
       
@@ -915,7 +915,7 @@
     operator==(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
     {
       return __x.size() == __y.size() &&
-             equal(__x.begin(), __x.end(), __y.begin());
+             std::equal(__x.begin(), __x.end(), __y.begin());
     }
   
   /**
@@ -933,8 +933,8 @@
     inline bool
     operator<(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
     {
-      return lexicographical_compare(__x.begin(), __x.end(),
-                                     __y.begin(), __y.end());
+      return std::lexicographical_compare(__x.begin(), __x.end(),
+					  __y.begin(), __y.end());
     }
   
   /// Based on operator==
diff -urN libstdc++-v3-orig/include/ext/rope libstdc++-v3/include/ext/rope
--- libstdc++-v3-orig/include/ext/rope	2003-06-11 17:52:10.000000000 +0200
+++ libstdc++-v3/include/ext/rope	2003-07-04 13:50:06.000000000 +0200
@@ -50,15 +50,14 @@
 #define _ROPE 1
 
 #include <bits/stl_algobase.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
 #include <bits/stl_algo.h>
 #include <bits/stl_function.h>
 #include <bits/stl_numeric.h>
 #include <bits/allocator.h>
-#include <bits/stl_construct.h>
-#include <bits/stl_uninitialized.h>
 #include <ext/hash_fun.h>
 
-
 # ifdef __GC
 #   define __GC_CONST const
 # else

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