Commit 9dd90ac6 by Paolo Carlini Committed by Paolo Carlini

stl_list.h: Fully qualify standard functions with std::, thus avoiding Koenig lookup.

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.

From-SVN: r68919
parent 1b33b6b2
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.
2003-07-04 Benjamin Kosnik <bkoz@redhat.com> 2003-07-04 Benjamin Kosnik <bkoz@redhat.com>
* configure.host (fpos_include_dir): Fix. * configure.host (fpos_include_dir): Fix.
......
...@@ -410,7 +410,7 @@ namespace std ...@@ -410,7 +410,7 @@ namespace std
{ {
_Node* __p = _M_get_node(); _Node* __p = _M_get_node();
try { try {
_Construct(&__p->_M_data, __x); std::_Construct(&__p->_M_data, __x);
} }
catch(...) catch(...)
{ {
...@@ -431,7 +431,7 @@ namespace std ...@@ -431,7 +431,7 @@ namespace std
{ {
_Node* __p = _M_get_node(); _Node* __p = _M_get_node();
try { try {
_Construct(&__p->_M_data); std::_Construct(&__p->_M_data);
} }
catch(...) catch(...)
{ {
...@@ -1073,8 +1073,8 @@ namespace std ...@@ -1073,8 +1073,8 @@ namespace std
inline bool inline bool
operator<(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y) operator<(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
{ {
return lexicographical_compare(__x.begin(), __x.end(), return std::lexicographical_compare(__x.begin(), __x.end(),
__y.begin(), __y.end()); __y.begin(), __y.end());
} }
/// Based on operator== /// Based on operator==
......
// Queue implementation -*- C++ -*- // 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 // 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 // software; you can redistribute it and/or modify it under the
...@@ -332,7 +332,7 @@ namespace std ...@@ -332,7 +332,7 @@ namespace std
priority_queue(const _Compare& __x = _Compare(), priority_queue(const _Compare& __x = _Compare(),
const _Sequence& __s = _Sequence()) const _Sequence& __s = _Sequence())
: c(__s), comp(__x) : 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. * @brief Builds a %queue from a range.
...@@ -355,7 +355,7 @@ namespace std ...@@ -355,7 +355,7 @@ namespace std
: c(__s), comp(__x) : c(__s), comp(__x)
{ {
c.insert(c.end(), __first, __last); 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 @@ namespace std ...@@ -389,7 +389,7 @@ namespace std
try try
{ {
c.push_back(__x); c.push_back(__x);
push_heap(c.begin(), c.end(), comp); std::push_heap(c.begin(), c.end(), comp);
} }
catch(...) catch(...)
{ {
...@@ -413,7 +413,7 @@ namespace std ...@@ -413,7 +413,7 @@ namespace std
{ {
try try
{ {
pop_heap(c.begin(), c.end(), comp); std::pop_heap(c.begin(), c.end(), comp);
c.pop_back(); c.pop_back();
} }
catch(...) catch(...)
......
...@@ -84,7 +84,7 @@ namespace std ...@@ -84,7 +84,7 @@ namespace std
raw_storage_iterator& raw_storage_iterator&
operator=(const _Tp& __element) operator=(const _Tp& __element)
{ {
_Construct(&*_M_iter, __element); std::_Construct(&*_M_iter, __element);
return *this; return *this;
} }
......
...@@ -99,7 +99,7 @@ template <class _ForwardIterator, class _Tp> ...@@ -99,7 +99,7 @@ template <class _ForwardIterator, class _Tp>
void _M_initialize_buffer(const _Tp&, __true_type) {} void _M_initialize_buffer(const _Tp&, __true_type) {}
void _M_initialize_buffer(const _Tp& val, __false_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: public:
...@@ -133,7 +133,7 @@ public: ...@@ -133,7 +133,7 @@ public:
} }
~_Temporary_buffer() { ~_Temporary_buffer() {
_Destroy(_M_buffer, _M_buffer + _M_len); std::_Destroy(_M_buffer, _M_buffer + _M_len);
free(_M_buffer); free(_M_buffer);
} }
......
...@@ -615,7 +615,7 @@ namespace std ...@@ -615,7 +615,7 @@ namespace std
{ {
_Link_type __tmp = _M_get_node(); _Link_type __tmp = _M_get_node();
try try
{ _Construct(&__tmp->_M_value_field, __x); } { std::_Construct(&__tmp->_M_value_field, __x); }
catch(...) catch(...)
{ {
_M_put_node(__tmp); _M_put_node(__tmp);
...@@ -637,7 +637,7 @@ namespace std ...@@ -637,7 +637,7 @@ namespace std
void void
destroy_node(_Link_type __p) destroy_node(_Link_type __p)
{ {
_Destroy(&__p->_M_value_field); std::_Destroy(&__p->_M_value_field);
_M_put_node(__p); _M_put_node(__p);
} }
......
...@@ -73,7 +73,7 @@ namespace std ...@@ -73,7 +73,7 @@ namespace std
__uninitialized_copy_aux(_InputIterator __first, _InputIterator __last, __uninitialized_copy_aux(_InputIterator __first, _InputIterator __last,
_ForwardIterator __result, _ForwardIterator __result,
__true_type) __true_type)
{ return copy(__first, __last, __result); } { return std::copy(__first, __last, __result); }
template<typename _InputIterator, typename _ForwardIterator> template<typename _InputIterator, typename _ForwardIterator>
_ForwardIterator _ForwardIterator
...@@ -84,12 +84,12 @@ namespace std ...@@ -84,12 +84,12 @@ namespace std
_ForwardIterator __cur = __result; _ForwardIterator __cur = __result;
try { try {
for ( ; __first != __last; ++__first, ++__cur) for ( ; __first != __last; ++__first, ++__cur)
_Construct(&*__cur, *__first); std::_Construct(&*__cur, *__first);
return __cur; return __cur;
} }
catch(...) catch(...)
{ {
_Destroy(__result, __cur); std::_Destroy(__result, __cur);
__throw_exception_again; __throw_exception_again;
} }
} }
...@@ -109,13 +109,13 @@ namespace std ...@@ -109,13 +109,13 @@ namespace std
{ {
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD; 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* inline char*
uninitialized_copy(const char* __first, const char* __last, char* __result) 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); return __result + (__last - __first);
} }
...@@ -123,7 +123,7 @@ namespace std ...@@ -123,7 +123,7 @@ namespace std
uninitialized_copy(const wchar_t* __first, const wchar_t* __last, uninitialized_copy(const wchar_t* __first, const wchar_t* __last,
wchar_t* __result) wchar_t* __result)
{ {
memmove(__result, __first, sizeof(wchar_t) * (__last - __first)); std::memmove(__result, __first, sizeof(wchar_t) * (__last - __first));
return __result + (__last - __first); return __result + (__last - __first);
} }
...@@ -133,7 +133,7 @@ namespace std ...@@ -133,7 +133,7 @@ namespace std
inline void inline void
__uninitialized_fill_aux(_ForwardIterator __first, _ForwardIterator __last, __uninitialized_fill_aux(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __x, __true_type) const _Tp& __x, __true_type)
{ fill(__first, __last, __x); } { std::fill(__first, __last, __x); }
template<typename _ForwardIterator, typename _Tp> template<typename _ForwardIterator, typename _Tp>
void void
...@@ -143,11 +143,11 @@ namespace std ...@@ -143,11 +143,11 @@ namespace std
_ForwardIterator __cur = __first; _ForwardIterator __cur = __first;
try { try {
for ( ; __cur != __last; ++__cur) for ( ; __cur != __last; ++__cur)
_Construct(&*__cur, __x); std::_Construct(&*__cur, __x);
} }
catch(...) catch(...)
{ {
_Destroy(__first, __cur); std::_Destroy(__first, __cur);
__throw_exception_again; __throw_exception_again;
} }
} }
...@@ -167,7 +167,7 @@ namespace std ...@@ -167,7 +167,7 @@ namespace std
{ {
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD; 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 // Valid if copy construction is equivalent to assignment, and if the
...@@ -177,7 +177,7 @@ namespace std ...@@ -177,7 +177,7 @@ namespace std
__uninitialized_fill_n_aux(_ForwardIterator __first, _Size __n, __uninitialized_fill_n_aux(_ForwardIterator __first, _Size __n,
const _Tp& __x, __true_type) 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> template<typename _ForwardIterator, typename _Size, typename _Tp>
...@@ -188,12 +188,12 @@ namespace std ...@@ -188,12 +188,12 @@ namespace std
_ForwardIterator __cur = __first; _ForwardIterator __cur = __first;
try { try {
for ( ; __n > 0; --__n, ++__cur) for ( ; __n > 0; --__n, ++__cur)
_Construct(&*__cur, __x); std::_Construct(&*__cur, __x);
return __cur; return __cur;
} }
catch(...) catch(...)
{ {
_Destroy(__first, __cur); std::_Destroy(__first, __cur);
__throw_exception_again; __throw_exception_again;
} }
} }
...@@ -213,7 +213,7 @@ namespace std ...@@ -213,7 +213,7 @@ namespace std
{ {
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD; 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, // Extensions: __uninitialized_copy_copy, __uninitialized_copy_fill,
...@@ -230,13 +230,13 @@ namespace std ...@@ -230,13 +230,13 @@ namespace std
_InputIterator2 __first2, _InputIterator2 __last2, _InputIterator2 __first2, _InputIterator2 __last2,
_ForwardIterator __result) _ForwardIterator __result)
{ {
_ForwardIterator __mid = uninitialized_copy(__first1, __last1, __result); _ForwardIterator __mid = std::uninitialized_copy(__first1, __last1, __result);
try { try {
return uninitialized_copy(__first2, __last2, __mid); return std::uninitialized_copy(__first2, __last2, __mid);
} }
catch(...) catch(...)
{ {
_Destroy(__result, __mid); std::_Destroy(__result, __mid);
__throw_exception_again; __throw_exception_again;
} }
} }
...@@ -250,13 +250,13 @@ namespace std ...@@ -250,13 +250,13 @@ namespace std
const _Tp& __x, const _Tp& __x,
_InputIterator __first, _InputIterator __last) _InputIterator __first, _InputIterator __last)
{ {
uninitialized_fill(__result, __mid, __x); std::uninitialized_fill(__result, __mid, __x);
try { try {
return uninitialized_copy(__first, __last, __mid); return std::uninitialized_copy(__first, __last, __mid);
} }
catch(...) catch(...)
{ {
_Destroy(__result, __mid); std::_Destroy(__result, __mid);
__throw_exception_again; __throw_exception_again;
} }
} }
...@@ -270,13 +270,13 @@ namespace std ...@@ -270,13 +270,13 @@ namespace std
_ForwardIterator __first2, _ForwardIterator __last2, _ForwardIterator __first2, _ForwardIterator __last2,
const _Tp& __x) const _Tp& __x)
{ {
_ForwardIterator __mid2 = uninitialized_copy(__first1, __last1, __first2); _ForwardIterator __mid2 = std::uninitialized_copy(__first1, __last1, __first2);
try { try {
uninitialized_fill(__mid2, __last2, __x); std::uninitialized_fill(__mid2, __last2, __x);
} }
catch(...) catch(...)
{ {
_Destroy(__first2, __mid2); std::_Destroy(__first2, __mid2);
__throw_exception_again; __throw_exception_again;
} }
} }
......
...@@ -239,7 +239,7 @@ namespace std ...@@ -239,7 +239,7 @@ namespace std
vector(size_type __n, const value_type& __value, vector(size_type __n, const value_type& __value,
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _Base(__n, __a) : _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. * @brief Create a %vector with default elements.
...@@ -251,8 +251,8 @@ namespace std ...@@ -251,8 +251,8 @@ namespace std
explicit explicit
vector(size_type __n) vector(size_type __n)
: _Base(__n, allocator_type()) : _Base(__n, allocator_type())
{ this->_M_finish = uninitialized_fill_n(this->_M_start, { this->_M_finish = std::uninitialized_fill_n(this->_M_start,
__n, value_type()); } __n, value_type()); }
/** /**
* @brief %Vector copy constructor. * @brief %Vector copy constructor.
...@@ -265,8 +265,8 @@ namespace std ...@@ -265,8 +265,8 @@ namespace std
*/ */
vector(const vector& __x) vector(const vector& __x)
: _Base(__x.size(), __x.get_allocator()) : _Base(__x.size(), __x.get_allocator())
{ this->_M_finish = uninitialized_copy(__x.begin(), __x.end(), { this->_M_finish = std::uninitialized_copy(__x.begin(), __x.end(),
this->_M_start); this->_M_start);
} }
/** /**
...@@ -298,7 +298,7 @@ namespace std ...@@ -298,7 +298,7 @@ namespace std
* themselves are pointers, the pointed-to memory is not touched in any * themselves are pointers, the pointed-to memory is not touched in any
* way. Managing the pointer is the user's responsibilty. * 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. * @brief %Vector assignment operator.
...@@ -600,7 +600,7 @@ namespace std ...@@ -600,7 +600,7 @@ namespace std
{ {
if (this->_M_finish != this->_M_end_of_storage) if (this->_M_finish != this->_M_end_of_storage)
{ {
_Construct(this->_M_finish, __x); std::_Construct(this->_M_finish, __x);
++this->_M_finish; ++this->_M_finish;
} }
else else
...@@ -619,7 +619,7 @@ namespace std ...@@ -619,7 +619,7 @@ namespace std
pop_back() pop_back()
{ {
--this->_M_finish; --this->_M_finish;
_Destroy(this->_M_finish); std::_Destroy(this->_M_finish);
} }
/** /**
...@@ -756,7 +756,7 @@ namespace std ...@@ -756,7 +756,7 @@ namespace std
pointer __result = _M_allocate(__n); pointer __result = _M_allocate(__n);
try try
{ {
uninitialized_copy(__first, __last, __result); std::uninitialized_copy(__first, __last, __result);
return __result; return __result;
} }
catch(...) catch(...)
...@@ -776,7 +776,7 @@ namespace std ...@@ -776,7 +776,7 @@ namespace std
{ {
this->_M_start = _M_allocate(__n); this->_M_start = _M_allocate(__n);
this->_M_end_of_storage = this->_M_start + __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 // Called by the range constructor to implement [23.1.1]/9
...@@ -809,8 +809,8 @@ namespace std ...@@ -809,8 +809,8 @@ namespace std
size_type __n = std::distance(__first, __last); size_type __n = std::distance(__first, __last);
this->_M_start = _M_allocate(__n); this->_M_start = _M_allocate(__n);
this->_M_end_of_storage = this->_M_start + __n; this->_M_end_of_storage = this->_M_start + __n;
this->_M_finish = uninitialized_copy(__first, __last, this->_M_finish = std::uninitialized_copy(__first, __last,
this->_M_start); this->_M_start);
} }
...@@ -915,7 +915,7 @@ namespace std ...@@ -915,7 +915,7 @@ namespace std
operator==(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y) operator==(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
{ {
return __x.size() == __y.size() && return __x.size() == __y.size() &&
equal(__x.begin(), __x.end(), __y.begin()); std::equal(__x.begin(), __x.end(), __y.begin());
} }
/** /**
...@@ -933,8 +933,8 @@ namespace std ...@@ -933,8 +933,8 @@ namespace std
inline bool inline bool
operator<(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y) operator<(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
{ {
return lexicographical_compare(__x.begin(), __x.end(), return std::lexicographical_compare(__x.begin(), __x.end(),
__y.begin(), __y.end()); __y.begin(), __y.end());
} }
/// Based on operator== /// Based on operator==
......
...@@ -50,15 +50,14 @@ ...@@ -50,15 +50,14 @@
#define _ROPE 1 #define _ROPE 1
#include <bits/stl_algobase.h> #include <bits/stl_algobase.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_algo.h> #include <bits/stl_algo.h>
#include <bits/stl_function.h> #include <bits/stl_function.h>
#include <bits/stl_numeric.h> #include <bits/stl_numeric.h>
#include <bits/allocator.h> #include <bits/allocator.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <ext/hash_fun.h> #include <ext/hash_fun.h>
# ifdef __GC # ifdef __GC
# define __GC_CONST const # define __GC_CONST const
# else # else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment