X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=libstdc%2B%2B-v3%2Finclude%2Fext%2Fslist;h=ea6c3c076e950c1f3aa1afcecf3d33bcbd7be1a2;hb=bc2631e0c645a95ba0e7bbc85c3ac3033ab49b3e;hp=fb886d8a7b9b87bdf09b556be03dc8d1f7b1eb5e;hpb=0aa06b18fc9f79ec12ab65a34913b4f67d2177d8;p=gcc.git diff --git a/libstdc++-v3/include/ext/slist b/libstdc++-v3/include/ext/slist index fb886d8a7b9..ea6c3c076e9 100644 --- a/libstdc++-v3/include/ext/slist +++ b/libstdc++-v3/include/ext/slist @@ -1,6 +1,7 @@ // Singly-linked list implementation -*- C++ -*- -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2004, 2005, 2007, 2008, 2009 +// 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 @@ -15,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -49,19 +50,21 @@ #ifndef _SLIST #define _SLIST 1 -#include +#include #include #include #include #include -namespace __gnu_cxx -{ +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + using std::size_t; using std::ptrdiff_t; using std::_Construct; using std::_Destroy; using std::allocator; + using std::__true_type; + using std::__false_type; struct _Slist_node_base { @@ -190,6 +193,7 @@ namespace __gnu_cxx typedef _Ref reference; typedef _Slist_node<_Tp> _Node; + explicit _Slist_iterator(_Node* __x) : _Slist_iterator_base(__x) {} @@ -324,12 +328,12 @@ namespace __gnu_cxx _M_create_node(const value_type& __x) { _Node* __node = this->_M_get_node(); - try + __try { get_allocator().construct(&__node->_M_data, __x); __node->_M_next = 0; } - catch(...) + __catch(...) { this->_M_put_node(__node); __throw_exception_again; @@ -341,12 +345,12 @@ namespace __gnu_cxx _M_create_node() { _Node* __node = this->_M_get_node(); - try + __try { get_allocator().construct(&__node->_M_data, value_type()); __node->_M_next = 0; } - catch(...) + __catch(...) { this->_M_put_node(__node); __throw_exception_again; @@ -403,7 +407,7 @@ namespace __gnu_cxx void assign(_InputIterator __first, _InputIterator __last) { - typedef typename _Is_integer<_InputIterator>::_Integral _Integral; + typedef typename std::__is_integer<_InputIterator>::__type _Integral; _M_assign_dispatch(__first, __last, _Integral()); } @@ -526,7 +530,7 @@ namespace __gnu_cxx _M_insert_after_range(_Node_base* __pos, _InIterator __first, _InIterator __last) { - typedef typename _Is_integer<_InIterator>::_Integral _Integral; + typedef typename std::__is_integer<_InIterator>::__type _Integral; _M_insert_after_range(__pos, __first, __last, _Integral()); } @@ -601,20 +605,26 @@ namespace __gnu_cxx iterator erase_after(iterator __before_first, iterator __last) - { return iterator((_Node*) this->_M_erase_after(__before_first._M_node, - __last._M_node)); } + { + return iterator((_Node*) this->_M_erase_after(__before_first._M_node, + __last._M_node)); + } iterator erase(iterator __pos) - { return (_Node*) this->_M_erase_after(__slist_previous(&this->_M_head, - __pos._M_node)); } + { + return iterator((_Node*) this->_M_erase_after + (__slist_previous(&this->_M_head, __pos._M_node))); + } iterator erase(iterator __first, iterator __last) - { return (_Node*) this->_M_erase_after(__slist_previous(&this->_M_head, - __first._M_node), - __last._M_node); } - + { + return iterator((_Node*) this->_M_erase_after + (__slist_previous(&this->_M_head, __first._M_node), + __last._M_node)); + } + void resize(size_type new_size, const _Tp& __x); @@ -1016,13 +1026,12 @@ namespace __gnu_cxx } } -} // namespace __gnu_cxx +_GLIBCXX_END_NAMESPACE + +_GLIBCXX_BEGIN_NAMESPACE(std) -namespace std -{ // Specialization of insert_iterator so that insertions will be constant // time rather than linear time. - template class insert_iterator<__gnu_cxx::slist<_Tp, _Alloc> > { @@ -1066,7 +1075,8 @@ namespace std insert_iterator<_Container>& operator++(int) { return *this; } -}; + }; + +_GLIBCXX_END_NAMESPACE -} // namespace std #endif