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] Qualify with std:: stl_algobase.h


Hi,

tested x86-linux, committed.

Paolo.

//////////
2003-06-30  Paolo Carlini  <pcarlini@unitus.it>

	* include/bits/stl_algobase.h: Fully qualify standard
	functions with std::, thus avoiding Koenig lookup.
diff -prN libstdc++-v3-orig/include/bits/stl_algobase.h libstdc++-v3/include/bits/stl_algobase.h
*** libstdc++-v3-orig/include/bits/stl_algobase.h	Tue Jun 10 23:52:23 2003
--- libstdc++-v3/include/bits/stl_algobase.h	Mon Jun 30 23:40:59 2003
*************** namespace std
*** 240,246 ****
      inline _Tp*
      __copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result)
      {
!       memmove(__result, __first, sizeof(_Tp) * (__last - __first));
        return __result + (__last - __first);
      }
  
--- 240,246 ----
      inline _Tp*
      __copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result)
      {
!       std::memmove(__result, __first, sizeof(_Tp) * (__last - __first));
        return __result + (__last - __first);
      }
  
*************** namespace std
*** 248,271 ****
      inline _OutputIterator
      __copy_aux2(_InputIterator __first, _InputIterator __last,
  		_OutputIterator __result, __false_type)
!     { return __copy(__first, __last, __result, __iterator_category(__first)); }
  
    template<typename _InputIterator, typename _OutputIterator>
      inline _OutputIterator
      __copy_aux2(_InputIterator __first, _InputIterator __last,
  		_OutputIterator __result, __true_type)
!     { return __copy(__first, __last, __result, __iterator_category(__first)); }
  
    template<typename _Tp>
      inline _Tp*
      __copy_aux2(_Tp* __first, _Tp* __last, _Tp* __result, __true_type)
!     { return __copy_trivial(__first, __last, __result); }
  
    template<typename _Tp>
      inline _Tp*
      __copy_aux2(const _Tp* __first, const _Tp* __last, _Tp* __result, 
  		__true_type)
!     { return __copy_trivial(__first, __last, __result); }
  
    template<typename _InputIterator, typename _OutputIterator>
      inline _OutputIterator
--- 248,271 ----
      inline _OutputIterator
      __copy_aux2(_InputIterator __first, _InputIterator __last,
  		_OutputIterator __result, __false_type)
!     { return std::__copy(__first, __last, __result, __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)); }
  
    template<typename _Tp>
      inline _Tp*
      __copy_aux2(_Tp* __first, _Tp* __last, _Tp* __result, __true_type)
!     { return std::__copy_trivial(__first, __last, __result); }
  
    template<typename _Tp>
      inline _Tp*
      __copy_aux2(const _Tp* __first, const _Tp* __last, _Tp* __result, 
  		__true_type)
!     { return std::__copy_trivial(__first, __last, __result); }
  
    template<typename _InputIterator, typename _OutputIterator>
      inline _OutputIterator
*************** namespace std
*** 276,283 ****
  	  _ValueType;
        typedef typename __type_traits<_ValueType>::has_trivial_assignment_operator
  	  _Trivial;
!       return _OutputIterator(__copy_aux2(__first, __last, __result.base(),
! 					 _Trivial()));
      }
  
    template<typename _InputIterator, typename _OutputIterator>
--- 276,283 ----
  	  _ValueType;
        typedef typename __type_traits<_ValueType>::has_trivial_assignment_operator
  	  _Trivial;
!       return _OutputIterator(std::__copy_aux2(__first, __last, __result.base(),
! 					      _Trivial()));
      }
  
    template<typename _InputIterator, typename _OutputIterator>
*************** namespace std
*** 288,294 ****
        typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
        typedef typename __type_traits<_ValueType>::has_trivial_assignment_operator
            _Trivial;
!       return __copy_aux2(__first, __last, __result, _Trivial());
      }
  
    template<typename _InputIterator, typename _OutputIterator>
--- 288,294 ----
        typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
        typedef typename __type_traits<_ValueType>::has_trivial_assignment_operator
            _Trivial;
!       return std::__copy_aux2(__first, __last, __result, _Trivial());
      }
  
    template<typename _InputIterator, typename _OutputIterator>
*************** namespace std
*** 297,303 ****
  	       _OutputIterator __result, __true_type)
      {
        typedef typename _Is_normal_iterator<_OutputIterator>::_Normal __Normal;
!       return __copy_ni2(__first.base(), __last.base(), __result, __Normal());
      }
  
    template<typename _InputIterator, typename _OutputIterator>
--- 297,303 ----
  	       _OutputIterator __result, __true_type)
      {
        typedef typename _Is_normal_iterator<_OutputIterator>::_Normal __Normal;
!       return std::__copy_ni2(__first.base(), __last.base(), __result, __Normal());
      }
  
    template<typename _InputIterator, typename _OutputIterator>
*************** namespace std
*** 306,312 ****
  	       _OutputIterator __result, __false_type)
      {
        typedef typename _Is_normal_iterator<_OutputIterator>::_Normal __Normal;
!       return __copy_ni2(__first, __last, __result, __Normal());
      }
  
    /**
--- 306,312 ----
  	       _OutputIterator __result, __false_type)
      {
        typedef typename _Is_normal_iterator<_OutputIterator>::_Normal __Normal;
!       return std::__copy_ni2(__first, __last, __result, __Normal());
      }
  
    /**
*************** namespace std
*** 332,338 ****
  	    typename iterator_traits<_InputIterator>::value_type>)
  
         typedef typename _Is_normal_iterator<_InputIterator>::_Normal __Normal;
!        return __copy_ni1(__first, __last, __result, __Normal());
      }
  
    template<typename _BidirectionalIterator1, typename _BidirectionalIterator2>
--- 332,338 ----
  	    typename iterator_traits<_InputIterator>::value_type>)
  
         typedef typename _Is_normal_iterator<_InputIterator>::_Normal __Normal;
!        return std::__copy_ni1(__first, __last, __result, __Normal());
      }
  
    template<typename _BidirectionalIterator1, typename _BidirectionalIterator2>
*************** namespace std
*** 369,376 ****
        copy(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, 
  	   _BidirectionalIterator2 __result)
        {
!         return __copy_backward(__first, __last, __result, 
! 			       __iterator_category(__first));
        }
      };
  
--- 369,376 ----
        copy(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, 
  	   _BidirectionalIterator2 __result)
        {
!         return std::__copy_backward(__first, __last, __result, 
! 				    __iterator_category(__first));
        }
      };
  
*************** namespace std
*** 381,387 ****
        copy(const _Tp* __first, const _Tp* __last, _Tp* __result)
        {
  	const ptrdiff_t _Num = __last - __first;
! 	memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
  	return __result - _Num;
        }
      };
--- 381,387 ----
        copy(const _Tp* __first, const _Tp* __last, _Tp* __result)
        {
  	const ptrdiff_t _Num = __last - __first;
! 	std::memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
  	return __result - _Num;
        }
      };
*************** namespace std
*** 392,398 ****
        static _Tp*
        copy(const _Tp* __first, const _Tp* __last, _Tp* __result)
        {
! 	return  __copy_backward_dispatch<_Tp*, _Tp*, __true_type>
  	  ::copy(__first, __last, __result);
        }
      };
--- 392,398 ----
        static _Tp*
        copy(const _Tp* __first, const _Tp* __last, _Tp* __result)
        {
! 	return  std::__copy_backward_dispatch<_Tp*, _Tp*, __true_type>
  	  ::copy(__first, __last, __result);
        }
      };
*************** namespace std
*** 403,424 ****
      {
        typedef typename __type_traits<typename iterator_traits<_BI2>::value_type>
  			    ::has_trivial_assignment_operator _Trivial;
!       return __copy_backward_dispatch<_BI1, _BI2, _Trivial>::copy(__first, 
! 								  __last, 
! 								  __result);
      }
  
    template <typename _BI1, typename _BI2>
      inline _BI2
      __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last,
  					   _BI2 __result, __true_type)
!     { return _BI2(__copy_backward_aux(__first, __last, __result.base())); }
  
    template <typename _BI1, typename _BI2>
      inline _BI2
      __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last,
  					   _BI2 __result, __false_type)
!     { return __copy_backward_aux(__first, __last, __result); }
  
    template <typename _BI1, typename _BI2>
      inline _BI2
--- 403,424 ----
      {
        typedef typename __type_traits<typename iterator_traits<_BI2>::value_type>
  			    ::has_trivial_assignment_operator _Trivial;
!       return std::__copy_backward_dispatch<_BI1, _BI2, _Trivial>::copy(__first, 
! 								       __last, 
! 								       __result);
      }
  
    template <typename _BI1, typename _BI2>
      inline _BI2
      __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last,
  					   _BI2 __result, __true_type)
!     { return _BI2(std::__copy_backward_aux(__first, __last, __result.base())); }
  
    template <typename _BI1, typename _BI2>
      inline _BI2
      __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last,
  					   _BI2 __result, __false_type)
!     { return std::__copy_backward_aux(__first, __last, __result); }
  
    template <typename _BI1, typename _BI2>
      inline _BI2
*************** namespace std
*** 426,434 ****
  					  _BI2 __result, __true_type)
      {
        typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal;
!       return __copy_backward_output_normal_iterator(__first.base(),
! 						    __last.base(), __result, 
! 						    __Normal());
      }
  
    template <typename _BI1, typename _BI2>
--- 426,434 ----
  					  _BI2 __result, __true_type)
      {
        typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal;
!       return std::__copy_backward_output_normal_iterator(__first.base(),
! 							 __last.base(), __result, 
! 							 __Normal());
      }
  
    template <typename _BI1, typename _BI2>
*************** namespace std
*** 437,444 ****
  					  _BI2 __result, __false_type)
      {
        typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal;
!       return __copy_backward_output_normal_iterator(__first, __last, __result,
! 						    __Normal());
      }
  
    /**
--- 437,444 ----
  					  _BI2 __result, __false_type)
      {
        typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal;
!       return std::__copy_backward_output_normal_iterator(__first, __last, __result,
! 							 __Normal());
      }
  
    /**
*************** namespace std
*** 467,474 ****
  	    typename iterator_traits<_BI2>::value_type>)
  
        typedef typename _Is_normal_iterator<_BI1>::_Normal __Normal;
!       return __copy_backward_input_normal_iterator(__first, __last, __result,
! 						   __Normal());
      }
  
  
--- 467,474 ----
  	    typename iterator_traits<_BI2>::value_type>)
  
        typedef typename _Is_normal_iterator<_BI1>::_Normal __Normal;
!       return std::__copy_backward_input_normal_iterator(__first, __last, __result,
! 							__Normal());
      }
  
  
*************** namespace std
*** 522,549 ****
    fill(unsigned char* __first, unsigned char* __last, const unsigned char& __c)
    {
      unsigned char __tmp = __c;
!     memset(__first, __tmp, __last - __first);
    }
  
    inline void
    fill(signed char* __first, signed char* __last, const signed char& __c)
    {
      signed char __tmp = __c;
!     memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
    }
  
    inline void
    fill(char* __first, char* __last, const char& __c)
    {
      char __tmp = __c;
!     memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
    }
  
    template<typename _Size>
      inline unsigned char*
      fill_n(unsigned char* __first, _Size __n, const unsigned char& __c)
      {
!       fill(__first, __first + __n, __c);
        return __first + __n;
      }
  
--- 522,549 ----
    fill(unsigned char* __first, unsigned char* __last, const unsigned char& __c)
    {
      unsigned char __tmp = __c;
!     std::memset(__first, __tmp, __last - __first);
    }
  
    inline void
    fill(signed char* __first, signed char* __last, const signed char& __c)
    {
      signed char __tmp = __c;
!     std::memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
    }
  
    inline void
    fill(char* __first, char* __last, const char& __c)
    {
      char __tmp = __c;
!     std::memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
    }
  
    template<typename _Size>
      inline unsigned char*
      fill_n(unsigned char* __first, _Size __n, const unsigned char& __c)
      {
!       std::fill(__first, __first + __n, __c);
        return __first + __n;
      }
  
*************** namespace std
*** 551,557 ****
      inline signed char*
      fill_n(char* __first, _Size __n, const signed char& __c)
      {
!       fill(__first, __first + __n, __c);
        return __first + __n;
      }
  
--- 551,557 ----
      inline signed char*
      fill_n(char* __first, _Size __n, const signed char& __c)
      {
!       std::fill(__first, __first + __n, __c);
        return __first + __n;
      }
  
*************** namespace std
*** 559,565 ****
      inline char*
      fill_n(char* __first, _Size __n, const char& __c)
      {
!       fill(__first, __first + __n, __c);
        return __first + __n;
      }
  
--- 559,565 ----
      inline char*
      fill_n(char* __first, _Size __n, const char& __c)
      {
!       std::fill(__first, __first + __n, __c);
        return __first + __n;
      }
  
*************** namespace std
*** 594,600 ****
  	  ++__first1;
  	  ++__first2;
          }
!       return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
      }
  
    /**
--- 594,600 ----
  	  ++__first1;
  	  ++__first2;
          }
!       return std::pair<_InputIterator1, _InputIterator2>(__first1, __first2);
      }
  
    /**
*************** namespace std
*** 625,631 ****
  	  ++__first1;
  	  ++__first2;
          }
!       return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
      }
  
    /**
--- 625,631 ----
  	  ++__first1;
  	  ++__first2;
          }
!       return std::pair<_InputIterator1, _InputIterator2>(__first1, __first2);
      }
  
    /**
*************** namespace std
*** 763,769 ****
    {
      const size_t __len1 = __last1 - __first1;
      const size_t __len2 = __last2 - __first2;
!     const int __result = memcmp(__first1, __first2, std::min(__len1, __len2));
      return __result != 0 ? __result < 0 : __len1 < __len2;
    }
  
--- 763,769 ----
    {
      const size_t __len1 = __last1 - __first1;
      const size_t __len2 = __last2 - __first2;
!     const int __result = std::memcmp(__first1, __first2, std::min(__len1, __len2));
      return __result != 0 ? __result < 0 : __len1 < __len2;
    }
  
*************** namespace std
*** 772,786 ****
  			  const char* __first2, const char* __last2)
    {
  #if CHAR_MAX == SCHAR_MAX
!     return lexicographical_compare((const signed char*) __first1,
! 				   (const signed char*) __last1,
! 				   (const signed char*) __first2,
! 				   (const signed char*) __last2);
  #else /* CHAR_MAX == SCHAR_MAX */
!     return lexicographical_compare((const unsigned char*) __first1,
! 				   (const unsigned char*) __last1,
! 				   (const unsigned char*) __first2,
! 				   (const unsigned char*) __last2);
  #endif /* CHAR_MAX == SCHAR_MAX */
    }
  
--- 772,786 ----
  			  const char* __first2, const char* __last2)
    {
  #if CHAR_MAX == SCHAR_MAX
!     return std::lexicographical_compare((const signed char*) __first1,
! 					(const signed char*) __last1,
! 					(const signed char*) __first2,
! 					(const signed char*) __last2);
  #else /* CHAR_MAX == SCHAR_MAX */
!     return std::lexicographical_compare((const unsigned char*) __first1,
! 					(const unsigned char*) __last1,
! 					(const unsigned char*) __first2,
! 					(const unsigned char*) __last2);
  #endif /* CHAR_MAX == SCHAR_MAX */
    }
  

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