[multiple changes]
authorPaolo Carlini <paolo@gcc.gnu.org>
Thu, 4 Oct 2007 15:12:34 +0000 (15:12 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 4 Oct 2007 15:12:34 +0000 (15:12 +0000)
2007-10-04  Paolo Carlini  <pcarlini@suse.de>

* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Likewise.

2007-10-04  Chris Jefferson  <chris@bubblescope.net>
    Paolo Carlini  <pcarlini@suse.de>

* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.

2007-10-04  Paolo Carlini  <pcarlini@suse.de>

Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h  (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h  (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.

From-SVN: r129013

22 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_bvector.h
libstdc++-v3/include/bits/stl_deque.h
libstdc++-v3/include/bits/stl_list.h
libstdc++-v3/include/bits/stl_map.h
libstdc++-v3/include/bits/stl_multimap.h
libstdc++-v3/include/bits/stl_multiset.h
libstdc++-v3/include/bits/stl_set.h
libstdc++-v3/include/bits/stl_tree.h
libstdc++-v3/include/bits/stl_vector.h
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc

index 09c73d6e12f357ce075333fb4eb65db9542d1853..d02e6026ede1a224955a8029e8459936fc5c7f15 100644 (file)
@@ -1,3 +1,93 @@
+2007-10-04  Paolo Carlini  <pcarlini@suse.de>
+
+       * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
+       Adjust dg-error line number.
+       * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
+       Likewise.
+       * testsuite/23_containers/vector/requirements/dr438/
+       constructor_1_neg.cc: Likewise.
+       * testsuite/23_containers/vector/requirements/dr438/
+       constructor_2_neg.cc: Likewise.
+       * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
+       Adjust dg-error line number.
+       * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
+       Likewise.
+       * testsuite/23_containers/deque/requirements/dr438/
+       constructor_1_neg.cc: Likewise.
+       * testsuite/23_containers/deque/requirements/dr438/
+       constructor_2_neg.cc: Likewise.
+       * testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
+       Adjust dg-error line number.
+       * testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
+       Likewise.
+       * testsuite/23_containers/list/requirements/dr438/
+       constructor_1_neg.cc: Likewise.
+       * testsuite/23_containers/list/requirements/dr438/
+       constructor_2_neg.cc: Likewise.
+
+2007-10-04  Chris Jefferson  <chris@bubblescope.net>
+           Paolo Carlini  <pcarlini@suse.de>
+
+       * include/bits/stl_list.h (list<>::list(list&&),
+       list<>::operator=(list&&)): Add.
+       (list<>::swap): Adjust.
+       (swap(list&&, list& __y), swap(list&, list&& __y)): Add.
+       * include/bits/stl_vector.h (vector<>::vector(vector&&),
+       vector<>::operator=(vector&&)): Add.
+       (vector<>::swap): Adjust.
+       (swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
+       * include/bits/stl_bvector.h (vector<>::vector(vector&&),
+       vector<>::operator=(vector&&)): Add.
+       (vector<>::swap): Adjust.
+       * include/bits/stl_deque.h (deque<>::deque(deque&&),
+       deque<>::operator=(deque&&)): Add.
+       (deque<>::swap): Adjust.
+       (swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
+       * include/bits/stl_set.h (set<>::set(set&&),
+       set<>::operator=(set&&)): Add.
+       (set<>::swap): Adjust.
+       (swap(set&&, set& __y), swap(set&, set&& __y)): Add.
+       * include/bits/stl_map.h (map<>::map(map&&),
+       map<>::operator=(map&&)): Add.
+       (map<>::swap): Adjust.
+       (swap(map&&, map& __y), swap(map&, map&& __y)): Add.
+       * include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
+       multiset<>::operator=(multiset&&)): Add.
+       (smultiet<>::swap): Adjust.
+       (swap(multiset&&, multiset& __y),
+       swap(multiset&, multiset&& __y)): Add.
+       * include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
+       multimap<>::operator=(multimap&&)): Add.
+       (multimap<>::swap): Adjust.
+       (swap(multimap&&, multimap& __y),
+       swap(multimap&, multimap&& __y)): Add.
+
+2007-10-04  Paolo Carlini  <pcarlini@suse.de>
+
+       Avoid copying some allocator objects.
+       * include/bits/stl_list.h (_List_impl::_List_impl(),
+       _List_base::_List_base(), list<>::list()): Add.
+       * include/bits/stl_vector.h  (_Vector_impl::_Vector_impl(),
+       _Vector_base::_Vector_base(), vector<>::vector()): Add.
+       * include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
+       _Bvector_base::_Bvector_base(), vector<>::vector()): Add.
+       * include/bits/stl_deque.h  (_Deque_impl::_Deque_impl(),
+       _Deque_base::_Deque_base(), deque<>::deque()): Add.
+       * include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
+       _Rb_tree_impl<>::_M_initialize): Add.
+       (_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
+       _Rb_tree(const _Rb_tree&)): Adjust.
+       * include/bits/stl_set.h (set<>::set(),
+       set(_InputIterator, _InputIterator)): Use _M_t default constructor. 
+       * include/bits/stl_map.h (map<>::map(), set(_InputIterator,
+       _InputIterator)): Use _M_t default constructor. 
+       * include/bits/stl_multiset.h (multiset<>::multiset(),
+       multiset(_InputIterator, _InputIterator)): Use _M_t default
+       constructor. 
+       * include/bits/stl_multimap.h (multimap<>::multimap(),
+       multimap(_InputIterator, _InputIterator)): Use _M_t default
+       constructor.
+
 2007-10-03  Chris Jefferson  <chris@bubblescope.net>
            Benjamin Kosnik  <bkoz@redhat.com>
 
index a2a86f26f17e3700c1174339b93bd26e59c6d2d8..db9061b90fb528562617ce5220c082ba0c82f8cd 100644 (file)
@@ -385,6 +385,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        _Bit_iterator   _M_start;
        _Bit_iterator   _M_finish;
        _Bit_type*      _M_end_of_storage;
+
+       _Bvector_impl()
+       : _Bit_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage(0)
+       { }
        _Bvector_impl(const _Bit_alloc_type& __a)
        : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0)
        { }
@@ -405,7 +410,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       get_allocator() const
       { return allocator_type(_M_get_Bit_allocator()); }
 
-      _Bvector_base(const allocator_type& __a) : _M_impl(__a) { }
+      _Bvector_base()
+      : _M_impl() { }
+      
+      _Bvector_base(const allocator_type& __a)
+      : _M_impl(__a) { }
 
       ~_Bvector_base()
       { this->_M_deallocate(); }
@@ -480,8 +489,11 @@ template<typename _Alloc>
     using _Base::_M_get_Bit_allocator;
 
   public:
+    vector()
+    : _Base() { }
+
     explicit
-    vector(const allocator_type& __a = allocator_type())
+    vector(const allocator_type& __a)
     : _Base(__a) { }
 
     explicit
@@ -501,6 +513,12 @@ template<typename _Alloc>
       _M_copy_aligned(__x.begin(), __x.end(), this->_M_impl._M_start);
     }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+    vector(vector&& __x)
+    : _Base(__x._M_get_Bit_allocator())
+    { this->swap(__x); }
+#endif
+
     template<typename _InputIterator>
       vector(_InputIterator __first, _InputIterator __last,
             const allocator_type& __a = allocator_type())
@@ -527,6 +545,15 @@ template<typename _Alloc>
       return *this;
     }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+    vector&
+    operator=(vector&& __x)
+    { 
+      this->swap(__x); 
+      return *this;
+    }
+#endif
+
     // assign(), a generalized assignment member function.  Two
     // versions: one that takes a count, and one that takes a range.
     // The range version is a member template, so we dispatch on whether
@@ -681,7 +708,11 @@ template<typename _Alloc>
     }
 
     void
-    swap(vector<bool, _Alloc>& __x)
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+    swap(vector&& __x)
+#else
+    swap(vector& __x)
+#endif
     {
       std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
       std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
index a0553961a5bbd3c18ce15e4d63d90c795d8f9a61..7a7b86e2d38ee6e5bb8852d8c88f991a184ad454 100644 (file)
@@ -123,13 +123,14 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
 
       _Deque_iterator(_Tp* __x, _Map_pointer __y)
       : _M_cur(__x), _M_first(*__y),
-        _M_last(*__y + _S_buffer_size()), _M_node(__y) {}
+        _M_last(*__y + _S_buffer_size()), _M_node(__y) { }
 
-      _Deque_iterator() : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) {}
+      _Deque_iterator()
+      : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) { }
 
       _Deque_iterator(const iterator& __x)
       : _M_cur(__x._M_cur), _M_first(__x._M_first),
-        _M_last(__x._M_last), _M_node(__x._M_node) {}
+        _M_last(__x._M_last), _M_node(__x._M_node) { }
 
       reference
       operator*() const
@@ -380,6 +381,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       typedef _Deque_iterator<_Tp, _Tp&, _Tp*>             iterator;
       typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
 
+      _Deque_base()
+      : _M_impl()
+      { _M_initialize_map(0); }
+
       _Deque_base(const allocator_type& __a, size_t __num_elements)
       : _M_impl(__a)
       { _M_initialize_map(__num_elements); }
@@ -406,6 +411,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        iterator _M_start;
        iterator _M_finish;
 
+       _Deque_impl()
+       : _Tp_alloc_type(), _M_map(0), _M_map_size(0),
+         _M_start(), _M_finish()
+       { }
+
        _Deque_impl(const _Tp_alloc_type& __a)
        : _Tp_alloc_type(__a), _M_map(0), _M_map_size(0),
          _M_start(), _M_finish()
@@ -679,14 +689,22 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       /**
        *  @brief  Default constructor creates no elements.
        */
+      deque()
+      : _Base() { }
+
+      /**
+       *  @brief  Creates a %deque with no elements.
+       *  @param  a  An allocator object.
+       */
       explicit
-      deque(const allocator_type& __a = allocator_type())
-      : _Base(__a, 0) {}
+      deque(const allocator_type& __a)
+      : _Base(__a, 0) { }
 
       /**
-       *  @brief  Create a %deque with copies of an exemplar element.
+       *  @brief  Creates a %deque with copies of an exemplar element.
        *  @param  n  The number of elements to initially create.
        *  @param  value  An element to copy.
+       *  @param  a  An allocator.
        *
        *  This constructor fills the %deque with @a n copies of @a value.
        */
@@ -709,10 +727,24 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
                                    this->_M_impl._M_start,
                                    _M_get_Tp_allocator()); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  %Deque move constructor.
+       *  @param  x  A %deque of identical element and allocator types.
+       *
+       *  The newly-created %deque contains the exact contents of @a x.
+       *  The contents of @a x are a valid, but unspecified %deque.
+       */
+      deque(deque&&  __x)
+      : _Base(__x._M_get_Tp_allocator(), 0)
+      { this->swap(__x); }
+#endif
+
       /**
        *  @brief  Builds a %deque from a range.
        *  @param  first  An input iterator.
        *  @param  last  An input iterator.
+       *  @param  a  An allocator object.
        *
        *  Create a %deque consisting of copies of the elements from [first,
        *  last).
@@ -751,6 +783,22 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       deque&
       operator=(const deque& __x);
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  %Deque move assignment operator.
+       *  @param  x  A %deque of identical element and allocator types.
+       *
+       *  The contents of @a x are moved into this deque (without copying).
+       *  @a x is a valid, but unspecified %deque.
+       */
+      deque&
+      operator=(deque&& __x)
+      {
+       this->swap(__x); 
+       return *this;
+      }
+#endif
+
       /**
        *  @brief  Assigns a given value to a %deque.
        *  @param  n  Number of elements to be assigned.
@@ -1194,7 +1242,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  std::swap(d1,d2) will feed to this function.
        */
       void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      swap(deque&& __x)
+#else
       swap(deque& __x)
+#endif
       {
        std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
        std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
@@ -1598,6 +1650,18 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
     swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y)
     { __x.swap(__y); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+  template<typename _Tp, typename _Alloc>
+    inline void
+    swap(deque<_Tp,_Alloc>&& __x, deque<_Tp,_Alloc>& __y)
+    { __x.swap(__y); }
+
+  template<typename _Tp, typename _Alloc>
+    inline void
+    swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>&& __y)
+    { __x.swap(__y); }
+#endif
+
 _GLIBCXX_END_NESTED_NAMESPACE
 
 #endif /* _STL_DEQUE_H */
index dac02c8e61689c0e7dfb2a938a1b70b4bd2d34bf..2b690eb54867dbf8a4cbd2a50278fb2eb24cde17 100644 (file)
@@ -305,6 +305,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       {
        _List_node_base _M_node;
 
+       _List_impl()
+       : _Node_alloc_type(), _M_node()
+       { }
+
        _List_impl(const _Node_alloc_type& __a)
        : _Node_alloc_type(__a), _M_node()
        { }
@@ -339,6 +343,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       get_allocator() const
       { return allocator_type(_M_get_Node_allocator()); }
 
+      _List_base()
+      : _M_impl()
+      { _M_init(); }
+
       _List_base(const allocator_type& __a)
       : _M_impl(__a)
       { _M_init(); }
@@ -468,14 +476,22 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       /**
        *  @brief  Default constructor creates no elements.
        */
+      list()
+      : _Base() { }
+
+      /**
+       *  @brief  Creates a %list with no elements.
+       *  @param  a  An allocator object.
+       */
       explicit
-      list(const allocator_type& __a = allocator_type())
+      list(const allocator_type& __a)
       : _Base(__a) { }
 
       /**
-       *  @brief  Create a %list with copies of an exemplar element.
+       *  @brief  Creates a %list with copies of an exemplar element.
        *  @param  n  The number of elements to initially create.
        *  @param  value  An element to copy.
+       *  @param  a  An allocator object.
        *
        *  This constructor fills the %list with @a n copies of @a value.
        */
@@ -496,10 +512,24 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       : _Base(__x._M_get_Node_allocator())
       { _M_initialize_dispatch(__x.begin(), __x.end(), __false_type()); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  %List move constructor.
+       *  @param  x  A %list of identical element and allocator types.
+       *
+       *  The newly-created %list contains the exact contents of @a x.
+       *  The contents of @a x are a valid, but unspecified %list.
+       */
+      list(list&& __x)
+      : _Base(__x._M_get_Node_allocator())
+      { this->swap(__x); }
+#endif
+
       /**
        *  @brief  Builds a %list from a range.
        *  @param  first  An input iterator.
        *  @param  last  An input iterator.
+       *  @param  a  An allocator object.
        *
        *  Create a %list consisting of copies of the elements from
        *  [@a first,@a last).  This is linear in N (where N is
@@ -533,6 +563,22 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       list&
       operator=(const list& __x);
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  %List move assignment operator.
+       *  @param  x  A %list of identical element and allocator types.
+       *
+       *  The contents of @a x are moved into this %list (without copying).
+       *  @a x is a valid, but unspecified %list
+       */
+      list&
+      operator=(list&& __x)
+      {
+       this->swap(__x); 
+       return *this;
+      }
+#endif
+
       /**
        *  @brief  Assigns a given value to a %list.
        *  @param  n  Number of elements to be assigned.
@@ -887,7 +933,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  function.
        */
       void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      swap(list&& __x)
+#else
       swap(list& __x)
+#endif
       {
        _List_node_base::swap(this->_M_impl._M_node, __x._M_impl._M_node);
 
@@ -1256,7 +1306,18 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
     swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
     { __x.swap(__y); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+  template<typename _Tp, typename _Alloc>
+    inline void
+    swap(list<_Tp, _Alloc>&& __x, list<_Tp, _Alloc>& __y)
+    { __x.swap(__y); }
+
+  template<typename _Tp, typename _Alloc>
+    inline void
+    swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>&& __y)
+    { __x.swap(__y); }
+#endif
+
 _GLIBCXX_END_NESTED_NAMESPACE
 
 #endif /* _STL_LIST_H */
-
index e1429ef6956795f14b88cd08ffcfb4e431db57f2..f4545a02d4e0df0d445d1bcc46c68a7db24589b2 100644 (file)
@@ -155,26 +155,42 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  @brief  Default constructor creates no elements.
        */
       map()
-      : _M_t(_Compare(), allocator_type()) { }
+      : _M_t() { }
 
-      // for some reason this was made a separate function
       /**
-       *  @brief  Default constructor creates no elements.
+       *  @brief  Creates a %map with no elements.
+       *  @param  comp  A comparison object.
+       *  @param  a  An allocator object.
        */
       explicit
-      map(const _Compare& __comp, const allocator_type& __a = allocator_type())
+      map(const _Compare& __comp,
+         const allocator_type& __a = allocator_type())
       : _M_t(__comp, __a) { }
 
       /**
-       *  @brief  Map copy constructor.
+       *  @brief  %Map copy constructor.
        *  @param  x  A %map of identical element and allocator types.
        *
-       *  The newly-created %map uses a copy of the allocation object used
-       *  by @a x.
+       *  The newly-created %map uses a copy of the allocation object
+       *  used by @a x.
        */
       map(const map& __x)
       : _M_t(__x._M_t) { }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  %Map move constructor.
+       *  @param  x  A %map of identical element and allocator types.
+       *
+       *  The newly-created %map contains the exact contents of @a x.
+       *  The contents of @a x are a valid, but unspecified %map.
+       */
+      map(map&& __x)
+      : _M_t(__x._M_t.key_comp(),
+            __x._M_t._M_get_Node_allocator())
+      { this->swap(__x); }
+#endif
+
       /**
        *  @brief  Builds a %map from a range.
        *  @param  first  An input iterator.
@@ -184,9 +200,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  This is linear in N if the range is already sorted, and NlogN
        *  otherwise (where N is distance(first,last)).
        */
-      template <typename _InputIterator>
+      template<typename _InputIterator>
         map(_InputIterator __first, _InputIterator __last)
-       : _M_t(_Compare(), allocator_type())
+       : _M_t()
         { _M_t._M_insert_unique(__first, __last); }
 
       /**
@@ -200,9 +216,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  This is linear in N if the range is already sorted, and NlogN
        *  otherwise (where N is distance(first,last)).
        */
-      template <typename _InputIterator>
+      template<typename _InputIterator>
         map(_InputIterator __first, _InputIterator __last,
-           const _Compare& __comp, const allocator_type& __a = allocator_type())
+           const _Compare& __comp,
+           const allocator_type& __a = allocator_type())
        : _M_t(__comp, __a)
         { _M_t._M_insert_unique(__first, __last); }
 
@@ -216,7 +233,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        */
 
       /**
-       *  @brief  Map assignment operator.
+       *  @brief  %Map assignment operator.
        *  @param  x  A %map of identical element and allocator types.
        *
        *  All the elements of @a x are copied, but unlike the copy constructor,
@@ -229,6 +246,22 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        return *this;
       }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  %Map move assignment operator.
+       *  @param  x  A %map of identical element and allocator types.
+       *
+       *  The contents of @a x are moved into this map (without copying).
+       *  @a x is a valid, but unspecified %map.
+       */
+      map&
+      operator=(map&& __x)
+      {
+       this->swap(__x); 
+       return *this;
+      }
+#endif
+
       /// Get a copy of the memory allocation object.
       allocator_type
       get_allocator() const
@@ -434,7 +467,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *
        *  Complexity similar to that of the range constructor.
        */
-      template <typename _InputIterator>
+      template<typename _InputIterator>
         void
         insert(_InputIterator __first, _InputIterator __last)
         { _M_t._M_insert_unique(__first, __last); }
@@ -495,7 +528,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  that std::swap(m1,m2) will feed to this function.
        */
       void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      swap(map&& __x)
+#else
       swap(map& __x)
+#endif
       { _M_t.swap(__x._M_t); }
 
       /**
@@ -656,15 +693,15 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       equal_range(const key_type& __x) const
       { return _M_t.equal_range(__x); }
 
-      template <typename _K1, typename _T1, typename _C1, typename _A1>
+      template<typename _K1, typename _T1, typename _C1, typename _A1>
         friend bool
-        operator== (const map<_K1, _T1, _C1, _A1>&,
-                   const map<_K1, _T1, _C1, _A1>&);
+        operator==(const map<_K1, _T1, _C1, _A1>&,
+                  const map<_K1, _T1, _C1, _A1>&);
 
-      template <typename _K1, typename _T1, typename _C1, typename _A1>
+      template<typename _K1, typename _T1, typename _C1, typename _A1>
         friend bool
-        operator< (const map<_K1, _T1, _C1, _A1>&,
-                  const map<_K1, _T1, _C1, _A1>&);
+        operator<(const map<_K1, _T1, _C1, _A1>&,
+                 const map<_K1, _T1, _C1, _A1>&);
     };
 
   /**
@@ -677,7 +714,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
    *  maps.  Maps are considered equivalent if their sizes are equal,
    *  and if corresponding elements compare equal.
   */
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline bool
     operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
                const map<_Key, _Tp, _Compare, _Alloc>& __y)
@@ -694,47 +731,61 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
    *
    *  See std::lexicographical_compare() for how the determination is made.
   */
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline bool
     operator<(const map<_Key, _Tp, _Compare, _Alloc>& __x,
               const map<_Key, _Tp, _Compare, _Alloc>& __y)
     { return __x._M_t < __y._M_t; }
 
   /// Based on operator==
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline bool
     operator!=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
                const map<_Key, _Tp, _Compare, _Alloc>& __y)
     { return !(__x == __y); }
 
   /// Based on operator<
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline bool
     operator>(const map<_Key, _Tp, _Compare, _Alloc>& __x,
               const map<_Key, _Tp, _Compare, _Alloc>& __y)
     { return __y < __x; }
 
   /// Based on operator<
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline bool
     operator<=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
                const map<_Key, _Tp, _Compare, _Alloc>& __y)
     { return !(__y < __x); }
 
   /// Based on operator<
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline bool
     operator>=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
                const map<_Key, _Tp, _Compare, _Alloc>& __y)
     { return !(__x < __y); }
 
   /// See std::map::swap().
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline void
     swap(map<_Key, _Tp, _Compare, _Alloc>& __x,
         map<_Key, _Tp, _Compare, _Alloc>& __y)
     { __x.swap(__y); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline void
+    swap(map<_Key, _Tp, _Compare, _Alloc>&& __x,
+        map<_Key, _Tp, _Compare, _Alloc>& __y)
+    { __x.swap(__y); }
+
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline void
+    swap(map<_Key, _Tp, _Compare, _Alloc>& __x,
+        map<_Key, _Tp, _Compare, _Alloc>&& __y)
+    { __x.swap(__y); }
+#endif
+
 _GLIBCXX_END_NESTED_NAMESPACE
 
 #endif /* _STL_MAP_H */
index 5730854ee6969e60debd7c319300091c85c7d870..864f4b21bbe8140113469df5d2c8cee4a67899a6 100644 (file)
@@ -153,11 +153,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  @brief  Default constructor creates no elements.
        */
       multimap()
-      : _M_t(_Compare(), allocator_type()) { }
+      : _M_t() { }
 
-      // for some reason this was made a separate function
       /**
-       *  @brief  Default constructor creates no elements.
+       *  @brief  Creates a %multimap with no elements.
+       *  @param  comp  A comparison object.
+       *  @param  a  An allocator object.
        */
       explicit
       multimap(const _Compare& __comp,
@@ -168,12 +169,26 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  @brief  %Multimap copy constructor.
        *  @param  x  A %multimap of identical element and allocator types.
        *
-       *  The newly-created %multimap uses a copy of the allocation object used
-       *  by @a x.
+       *  The newly-created %multimap uses a copy of the allocation object
+       *  used by @a x.
        */
       multimap(const multimap& __x)
       : _M_t(__x._M_t) { }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  %Multimap move constructor.
+       *  @param   x  A %multimap of identical element and allocator types.
+       *
+       *  The newly-created %multimap contains the exact contents of @a x.
+       *  The contents of @a x are a valid, but unspecified %multimap.
+       */
+      multimap(multimap&& __x)
+      : _M_t(__x._M_t.key_comp(),
+            __x._M_t._M_get_Node_allocator())
+      { this->swap(__x); }
+#endif
+
       /**
        *  @brief  Builds a %multimap from a range.
        *  @param  first  An input iterator.
@@ -183,10 +198,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  [first,last).  This is linear in N if the range is already sorted,
        *  and NlogN otherwise (where N is distance(first,last)).
        */
-      template <typename _InputIterator>
+      template<typename _InputIterator>
         multimap(_InputIterator __first, _InputIterator __last)
-       : _M_t(_Compare(), allocator_type())
-        { _M_t._M_insert_equal(__first, __last); }
+       : _M_t()
+        { _M_t._M_insert_unique(__first, __last); }
 
       /**
        *  @brief  Builds a %multimap from a range.
@@ -199,7 +214,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  [first,last).  This is linear in N if the range is already sorted,
        *  and NlogN otherwise (where N is distance(first,last)).
        */
-      template <typename _InputIterator>
+      template<typename _InputIterator>
         multimap(_InputIterator __first, _InputIterator __last,
                 const _Compare& __comp,
                 const allocator_type& __a = allocator_type())
@@ -229,6 +244,22 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        return *this;
       }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  %Multimap move assignment operator.
+       *  @param  x  A %multimap of identical element and allocator types.
+       *
+       *  The contents of @a x are moved into this multimap (without copying).
+       *  @a x is a valid, but unspecified multimap.
+       */
+      multimap&
+      operator=(multimap&& __x)
+      {
+       this->swap(__x); 
+       return *this;
+      }
+#endif
+
       /// Get a copy of the memory allocation object.
       allocator_type
       get_allocator() const
@@ -372,7 +403,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *
        *  Complexity similar to that of the range constructor.
        */
-      template <typename _InputIterator>
+      template<typename _InputIterator>
         void
         insert(_InputIterator __first, _InputIterator __last)
         { _M_t._M_insert_equal(__first, __last); }
@@ -433,7 +464,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  std::swap(m1,m2) will feed to this function.
        */
       void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      swap(multimap&& __x)
+#else
       swap(multimap& __x)
+#endif
       { _M_t.swap(__x._M_t); }
 
       /**
@@ -587,15 +622,15 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       equal_range(const key_type& __x) const
       { return _M_t.equal_range(__x); }
 
-      template <typename _K1, typename _T1, typename _C1, typename _A1>
+      template<typename _K1, typename _T1, typename _C1, typename _A1>
         friend bool
-        operator== (const multimap<_K1, _T1, _C1, _A1>&,
-                   const multimap<_K1, _T1, _C1, _A1>&);
+        operator==(const multimap<_K1, _T1, _C1, _A1>&,
+                  const multimap<_K1, _T1, _C1, _A1>&);
 
-      template <typename _K1, typename _T1, typename _C1, typename _A1>
+      template<typename _K1, typename _T1, typename _C1, typename _A1>
         friend bool
-        operator< (const multimap<_K1, _T1, _C1, _A1>&,
-                  const multimap<_K1, _T1, _C1, _A1>&);
+        operator<(const multimap<_K1, _T1, _C1, _A1>&,
+                 const multimap<_K1, _T1, _C1, _A1>&);
   };
 
   /**
@@ -608,7 +643,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
    *  multimaps.  Multimaps are considered equivalent if their sizes are equal,
    *  and if corresponding elements compare equal.
   */
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline bool
     operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
                const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
@@ -625,47 +660,61 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
    *
    *  See std::lexicographical_compare() for how the determination is made.
   */
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline bool
     operator<(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
               const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
     { return __x._M_t < __y._M_t; }
 
   /// Based on operator==
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline bool
     operator!=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
                const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
     { return !(__x == __y); }
 
   /// Based on operator<
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline bool
     operator>(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
               const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
     { return __y < __x; }
 
   /// Based on operator<
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline bool
     operator<=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
                const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
     { return !(__y < __x); }
 
   /// Based on operator<
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline bool
     operator>=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
                const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
     { return !(__x < __y); }
 
   /// See std::multimap::swap().
-  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
     inline void
     swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
          multimap<_Key, _Tp, _Compare, _Alloc>& __y)
     { __x.swap(__y); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline void
+    swap(multimap<_Key, _Tp, _Compare, _Alloc>&& __x,
+         multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+    { __x.swap(__y); }
+
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline void
+    swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+         multimap<_Key, _Tp, _Compare, _Alloc>&& __y)
+    { __x.swap(__y); }
+#endif
+
 _GLIBCXX_END_NESTED_NAMESPACE
 
 #endif /* _STL_MULTIMAP_H */
index dab8d6f47f3d275edeb23bdda2e10305239fd2f4..6e45b8fbcb4c094f236709b4afe0917cd4d53308 100644 (file)
@@ -86,8 +86,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
    *  called (*_unique versus *_equal, same as the standard).
    *  @endif
   */
-  template <class _Key, class _Compare = std::less<_Key>,
-           class _Alloc = std::allocator<_Key> >
+  template <typename _Key, typename _Compare = std::less<_Key>,
+           typename _Alloc = std::allocator<_Key> >
     class multiset
     {
       // concept requirements
@@ -130,13 +130,17 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       typedef typename _Rep_type::difference_type           difference_type;
 
       // allocation/deallocation
-
       /**
        *  @brief  Default constructor creates no elements.
        */
       multiset()
-      : _M_t(_Compare(), allocator_type()) { }
+      : _M_t() { }
 
+      /**
+       *  @brief  Creates a %multiset with no elements.
+       *  @param  comp  Comparator to use.
+       *  @param  a  An allocator object.
+       */
       explicit
       multiset(const _Compare& __comp,
               const allocator_type& __a = allocator_type())
@@ -151,9 +155,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  [first,last).  This is linear in N if the range is already sorted,
        *  and NlogN otherwise (where N is distance(first,last)).
        */
-      template <class _InputIterator>
+      template<typename _InputIterator>
         multiset(_InputIterator __first, _InputIterator __last)
-       : _M_t(_Compare(), allocator_type())
+       : _M_t()
         { _M_t._M_insert_equal(__first, __last); }
 
       /**
@@ -167,7 +171,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  [first,last).  This is linear in N if the range is already sorted,
        *  and NlogN otherwise (where N is distance(first,last)).
        */
-      template <class _InputIterator>
+      template<typename _InputIterator>
         multiset(_InputIterator __first, _InputIterator __last,
                 const _Compare& __comp,
                 const allocator_type& __a = allocator_type())
@@ -181,9 +185,23 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  The newly-created %multiset uses a copy of the allocation object used
        *  by @a x.
        */
-      multiset(const multiset<_Key,_Compare,_Alloc>& __x)
+      multiset(const multiset& __x)
       : _M_t(__x._M_t) { }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+     /**
+       *  @brief  %Multiset move constructor.
+       *  @param  x  A %multiset of identical element and allocator types.
+       *
+       *  The newly-created %multiset contains the exact contents of @a x.
+       *  The contents of @a x are a valid, but unspecified %multiset.
+       */
+      multiset(multiset&& __x)
+      : _M_t(__x._M_t.key_comp(),
+            __x._M_t._M_get_Node_allocator())
+      { this->swap(__x); }
+#endif
+
       /**
        *  @brief  %Multiset assignment operator.
        *  @param  x  A %multiset of identical element and allocator types.
@@ -191,13 +209,29 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  All the elements of @a x are copied, but unlike the copy constructor,
        *  the allocator object is not copied.
        */
-      multiset<_Key,_Compare,_Alloc>&
-      operator=(const multiset<_Key,_Compare,_Alloc>& __x)
+      multiset&
+      operator=(const multiset& __x)
       {
        _M_t = __x._M_t;
        return *this;
       }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  %Multiset move assignment operator.
+       *  @param  x  A %multiset of identical element and allocator types.
+       *
+       *  The contents of @a x are moved into this %multiset (without copying).
+       *  @a x is a valid, but unspecified %multiset.
+       */
+      multiset&
+      operator=(multiset&& __x)
+      {
+       this->swap(__x); 
+       return *this;
+      }
+#endif
+
       // accessors:
 
       ///  Returns the comparison object.
@@ -276,7 +310,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  std::swap(s1,s2) will feed to this function.
        */
       void
-      swap(multiset<_Key, _Compare, _Alloc>& __x)
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      swap(multiset&& __x)
+#else
+      swap(multiset& __x)
+#endif
       { _M_t.swap(__x._M_t); }
 
       // insert/erase
@@ -327,7 +365,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *
        *  Complexity similar to that of the range constructor.
        */
-      template <class _InputIterator>
+      template<typename _InputIterator>
         void
         insert(_InputIterator __first, _InputIterator __last)
         { _M_t._M_insert_equal(__first, __last); }
@@ -481,12 +519,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       equal_range(const key_type& __x) const
       { return _M_t.equal_range(__x); }
 
-      template <class _K1, class _C1, class _A1>
+      template<typename _K1, typename _C1, typename _A1>
         friend bool
-        operator== (const multiset<_K1, _C1, _A1>&,
-                   const multiset<_K1, _C1, _A1>&);
+        operator==(const multiset<_K1, _C1, _A1>&,
+                  const multiset<_K1, _C1, _A1>&);
 
-      template <class _K1, class _C1, class _A1>
+      template<typename _K1, typename _C1, typename _A1>
         friend bool
         operator< (const multiset<_K1, _C1, _A1>&,
                   const multiset<_K1, _C1, _A1>&);
@@ -503,7 +541,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
    *  Multisets are considered equivalent if their sizes are equal, and if
    *  corresponding elements compare equal.
   */
-  template <class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline bool
     operator==(const multiset<_Key, _Compare, _Alloc>& __x,
               const multiset<_Key, _Compare, _Alloc>& __y)
@@ -520,47 +558,61 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
    *
    *  See std::lexicographical_compare() for how the determination is made.
   */
-  template <class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline bool
     operator<(const multiset<_Key, _Compare, _Alloc>& __x,
              const multiset<_Key, _Compare, _Alloc>& __y)
     { return __x._M_t < __y._M_t; }
 
   ///  Returns !(x == y).
-  template <class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline bool
     operator!=(const multiset<_Key, _Compare, _Alloc>& __x,
               const multiset<_Key, _Compare, _Alloc>& __y)
     { return !(__x == __y); }
 
   ///  Returns y < x.
-  template <class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline bool
     operator>(const multiset<_Key,_Compare,_Alloc>& __x,
              const multiset<_Key,_Compare,_Alloc>& __y)
     { return __y < __x; }
 
   ///  Returns !(y < x)
-  template <class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline bool
     operator<=(const multiset<_Key, _Compare, _Alloc>& __x,
               const multiset<_Key, _Compare, _Alloc>& __y)
     { return !(__y < __x); }
 
   ///  Returns !(x < y)
-  template <class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline bool
     operator>=(const multiset<_Key, _Compare, _Alloc>& __x,
               const multiset<_Key, _Compare, _Alloc>& __y)
     { return !(__x < __y); }
 
   /// See std::multiset::swap().
-  template <class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline void
     swap(multiset<_Key, _Compare, _Alloc>& __x,
         multiset<_Key, _Compare, _Alloc>& __y)
     { __x.swap(__y); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+  template<typename _Key, typename _Compare, typename _Alloc>
+    inline void
+    swap(multiset<_Key, _Compare, _Alloc>&& __x,
+        multiset<_Key, _Compare, _Alloc>& __y)
+    { __x.swap(__y); }
+
+  template<typename _Key, typename _Compare, typename _Alloc>
+    inline void
+    swap(multiset<_Key, _Compare, _Alloc>& __x,
+        multiset<_Key, _Compare, _Alloc>&& __y)
+    { __x.swap(__y); }
+#endif
+
 _GLIBCXX_END_NESTED_NAMESPACE
 
 #endif /* _STL_MULTISET_H */
index 3bddefc635d7428bc3c8ef359b3bafb527733582..2b51bfaa9700f208ed6e3f6110efef75cca85799 100644 (file)
@@ -89,8 +89,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
    *  called (*_unique versus *_equal, same as the standard).
    *  @endif
   */
-  template<class _Key, class _Compare = std::less<_Key>,
-          class _Alloc = std::allocator<_Key> >
+  template<typename _Key, typename _Compare = std::less<_Key>,
+          typename _Alloc = std::allocator<_Key> >
     class set
     {
       // concept requirements
@@ -137,20 +137,21 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       //@}
 
       // allocation/deallocation
-      ///  Default constructor creates no elements.
+      /**
+       *  @brief  Default constructor creates no elements.
+       */
       set()
-      : _M_t(_Compare(), allocator_type()) {}
+      : _M_t() { }
 
       /**
-       *  @brief  Default constructor creates no elements.
-       *
+       *  @brief  Creates a %set with no elements.
        *  @param  comp  Comparator to use.
-       *  @param  a  Allocator to use.
+       *  @param  a  An allocator object.
        */
       explicit
       set(const _Compare& __comp,
          const allocator_type& __a = allocator_type())
-      : _M_t(__comp, __a) {}
+      : _M_t(__comp, __a) { }
 
       /**
        *  @brief  Builds a %set from a range.
@@ -161,9 +162,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  This is linear in N if the range is already sorted, and NlogN
        *  otherwise (where N is distance(first,last)).
        */
-      template<class _InputIterator>
+      template<typename _InputIterator>
         set(_InputIterator __first, _InputIterator __last)
-        : _M_t(_Compare(), allocator_type())
+       : _M_t()
         { _M_t._M_insert_unique(__first, __last); }
 
       /**
@@ -177,7 +178,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  This is linear in N if the range is already sorted, and NlogN
        *  otherwise (where N is distance(first,last)).
        */
-      template<class _InputIterator>
+      template<typename _InputIterator>
         set(_InputIterator __first, _InputIterator __last,
            const _Compare& __comp,
            const allocator_type& __a = allocator_type())
@@ -185,29 +186,59 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
         { _M_t._M_insert_unique(__first, __last); }
 
       /**
-       *  @brief  Set copy constructor.
+       *  @brief  %Set copy constructor.
        *  @param  x  A %set of identical element and allocator types.
        *
        *  The newly-created %set uses a copy of the allocation object used
        *  by @a x.
        */
-      set(const set<_Key,_Compare,_Alloc>& __x)
+      set(const set& __x)
       : _M_t(__x._M_t) { }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+     /**
+       *  @brief %Set move constructor
+       *  @param x  A %set of identical element and allocator types.
+       *
+       *  The newly-created %set contains the exact contents of @a x.
+       *  The contents of @a x are a valid, but unspecified %set.
+       */
+      set(set&& __x)
+      : _M_t(__x._M_t.key_comp(),
+            __x._M_t._M_get_Node_allocator())
+      { this->swap(__x); }
+#endif
+
       /**
-       *  @brief  Set assignment operator.
+       *  @brief  %Set assignment operator.
        *  @param  x  A %set of identical element and allocator types.
        *
        *  All the elements of @a x are copied, but unlike the copy constructor,
        *  the allocator object is not copied.
        */
-      set<_Key,_Compare,_Alloc>&
-      operator=(const set<_Key, _Compare, _Alloc>& __x)
+      set&
+      operator=(const set& __x)
       {
        _M_t = __x._M_t;
        return *this;
       }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief %Set move assignment operator.
+       *  @param x  A %set of identical element and allocator types.
+       *
+       *  The contents of @a x are moved into this %set (without copying).
+       *  @a x is a valid, but unspecified %set.
+       */
+      set&
+      operator=(set&& __x)
+      {
+       this->swap(__x); 
+       return *this;
+      }
+#endif
+
       // accessors:
 
       ///  Returns the comparison object with which the %set was constructed.
@@ -284,7 +315,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  std::swap(s1,s2) will feed to this function.
        */
       void
-      swap(set<_Key,_Compare,_Alloc>& __x)
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      swap(set&& __x)
+#else
+      swap(set& __x)   
+#endif
       { _M_t.swap(__x._M_t); }
 
       // insert/erase
@@ -301,7 +336,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *
        *  Insertion requires logarithmic time.
        */
-      std::pair<iterator,bool>
+      std::pair<iterator, bool>
       insert(const value_type& __x)
       {
        std::pair<typename _Rep_type::iterator, bool> __p =
@@ -340,7 +375,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *
        *  Complexity similar to that of the range constructor.
        */
-      template<class _InputIterator>
+      template<typename _InputIterator>
         void
         insert(_InputIterator __first, _InputIterator __last)
         { _M_t._M_insert_unique(__first, __last); }
@@ -497,13 +532,13 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       { return _M_t.equal_range(__x); }
       //@}
 
-      template<class _K1, class _C1, class _A1>
+      template<typename _K1, typename _C1, typename _A1>
         friend bool
-        operator== (const set<_K1, _C1, _A1>&, const set<_K1, _C1, _A1>&);
+        operator==(const set<_K1, _C1, _A1>&, const set<_K1, _C1, _A1>&);
 
-      template<class _K1, class _C1, class _A1>
+      template<typename _K1, typename _C1, typename _A1>
         friend bool
-        operator< (const set<_K1, _C1, _A1>&, const set<_K1, _C1, _A1>&);
+        operator<(const set<_K1, _C1, _A1>&, const set<_K1, _C1, _A1>&);
     };
 
 
@@ -517,7 +552,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
    *  Sets are considered equivalent if their sizes are equal, and if
    *  corresponding elements compare equal.
   */
-  template<class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline bool
     operator==(const set<_Key, _Compare, _Alloc>& __x,
               const set<_Key, _Compare, _Alloc>& __y)
@@ -534,46 +569,58 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
    *
    *  See std::lexicographical_compare() for how the determination is made.
   */
-  template<class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline bool
     operator<(const set<_Key, _Compare, _Alloc>& __x,
              const set<_Key, _Compare, _Alloc>& __y)
     { return __x._M_t < __y._M_t; }
 
   ///  Returns !(x == y).
-  template<class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline bool
     operator!=(const set<_Key, _Compare, _Alloc>& __x,
               const set<_Key, _Compare, _Alloc>& __y)
     { return !(__x == __y); }
 
   ///  Returns y < x.
-  template<class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline bool
     operator>(const set<_Key, _Compare, _Alloc>& __x,
              const set<_Key, _Compare, _Alloc>& __y)
     { return __y < __x; }
 
   ///  Returns !(y < x)
-  template<class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline bool
     operator<=(const set<_Key, _Compare, _Alloc>& __x,
               const set<_Key, _Compare, _Alloc>& __y)
     { return !(__y < __x); }
 
   ///  Returns !(x < y)
-  template<class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline bool
     operator>=(const set<_Key, _Compare, _Alloc>& __x,
               const set<_Key, _Compare, _Alloc>& __y)
     { return !(__x < __y); }
 
   /// See std::set::swap().
-  template<class _Key, class _Compare, class _Alloc>
+  template<typename _Key, typename _Compare, typename _Alloc>
     inline void
     swap(set<_Key, _Compare, _Alloc>& __x, set<_Key, _Compare, _Alloc>& __y)
     { __x.swap(__y); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+  template<typename _Key, typename _Compare, typename _Alloc>
+    inline void
+    swap(set<_Key, _Compare, _Alloc>&& __x, set<_Key, _Compare, _Alloc>& __y)
+    { __x.swap(__y); }
+
+  template<typename _Key, typename _Compare, typename _Alloc>
+    inline void
+    swap(set<_Key, _Compare, _Alloc>& __x, set<_Key, _Compare, _Alloc>&& __y)
+    { __x.swap(__y); }
+#endif
+
 _GLIBCXX_END_NESTED_NAMESPACE
 
 #endif /* _STL_SET_H */
index 8437c9a99526bfc251036ed93545cda85104c601..1b9743f1b4ef7f86bd9214075d0e8c82ead8e8ac 100644 (file)
@@ -400,16 +400,25 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
          _Rb_tree_node_base    _M_header;
          size_type             _M_node_count; // Keeps track of size of tree.
 
-         _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(),
-                       const _Key_compare& __comp = _Key_compare())
-         : _Node_allocator(__a), _M_key_compare(__comp), _M_header(), 
+         _Rb_tree_impl()
+         : _Node_allocator(), _M_key_compare(), _M_header(),
            _M_node_count(0)
+         { _M_initialize(); }
+
+         _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
+         : _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
+           _M_node_count(0)
+         { _M_initialize(); }
+
+       private:
+         void
+         _M_initialize()
          {
            this->_M_header._M_color = _S_red;
            this->_M_header._M_parent = 0;
            this->_M_header._M_left = &this->_M_header;
            this->_M_header._M_right = &this->_M_header;
-         }
+         }         
        };
 
       // Specialization for _Comparison types that are not capable of
@@ -421,16 +430,25 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
          _Rb_tree_node_base    _M_header;
          size_type             _M_node_count; // Keeps track of size of tree.
 
-         _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(),
-                       const _Key_compare& __comp = _Key_compare())
+         _Rb_tree_impl()
+         : _Node_allocator(), _M_key_compare(), _M_header(),
+           _M_node_count(0)
+         { _M_initialize(); }
+
+         _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
          : _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
            _M_node_count(0)
-         { 
+         { _M_initialize(); }
+
+       private:
+         void
+         _M_initialize()
+         {
            this->_M_header._M_color = _S_red;
            this->_M_header._M_parent = 0;
            this->_M_header._M_left = &this->_M_header;
            this->_M_header._M_right = &this->_M_header;
-         }
+         }         
        };
 
       _Rb_tree_impl<_Compare> _M_impl;
@@ -571,19 +589,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
     public:
       // allocation/deallocation
-      _Rb_tree()
-      { }
+      _Rb_tree() { }
 
-      _Rb_tree(const _Compare& __comp)
-      : _M_impl(allocator_type(), __comp)
-      { }
+      _Rb_tree(const _Compare& __comp,
+              const allocator_type& __a = allocator_type())
+      : _M_impl(__comp, __a) { }
 
-      _Rb_tree(const _Compare& __comp, const allocator_type& __a)
-      : _M_impl(__a, __comp)
-      { }
-
-      _Rb_tree(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x)
-      : _M_impl(__x._M_get_Node_allocator(), __x._M_impl._M_key_compare)
+      _Rb_tree(const _Rb_tree& __x)
+      : _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator())
       {
        if (__x._M_root() != 0)
          {
@@ -597,8 +610,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       ~_Rb_tree()
       { _M_erase(_M_begin()); }
 
-      _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&
-      operator=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x);
+      _Rb_tree&
+      operator=(const _Rb_tree& __x);
 
       // Accessors.
       _Compare
@@ -659,7 +672,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       { return get_allocator().max_size(); }
 
       void
-      swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t);
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      swap(_Rb_tree&& __t);
+#else
+      swap(_Rb_tree& __t);      
+#endif
 
       // Insert/erase.
       pair<iterator, bool>
@@ -1060,7 +1077,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
            typename _Compare, typename _Alloc>
     void
     _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+    swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&& __t)
+#else
     swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t)
+#endif
     {
       if (_M_root() == 0)
        {
index 93db4138bdd8c566fb630d2ec6e95c34fa0ef295..2f3384d8cc11c712fdb8136bd20603e6c4fb8fdc 100644 (file)
@@ -84,6 +84,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        _Tp*           _M_start;
        _Tp*           _M_finish;
        _Tp*           _M_end_of_storage;
+
+       _Vector_impl()
+       : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
+       { }
+
        _Vector_impl(_Tp_alloc_type const& __a)
        : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
        { }
@@ -104,9 +109,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       get_allocator() const
       { return allocator_type(_M_get_Tp_allocator()); }
 
+      _Vector_base()
+      : _M_impl() { }
+
       _Vector_base(const allocator_type& __a)
-      : _M_impl(__a)
-      { }
+      : _M_impl(__a) { }
 
       _Vector_base(size_t __n, const allocator_type& __a)
       : _M_impl(__a)
@@ -194,15 +201,22 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       /**
        *  @brief  Default constructor creates no elements.
        */
+      vector()
+      : _Base() { }
+
+      /**
+       *  @brief  Creates a %vector with no elements.
+       *  @param  a  An allocator object.
+       */
       explicit
-      vector(const allocator_type& __a = allocator_type())
-      : _Base(__a)
-      { }
+      vector(const allocator_type& __a)
+      : _Base(__a) { }
 
       /**
-       *  @brief  Create a %vector with copies of an exemplar element.
+       *  @brief  Creates a %vector with copies of an exemplar element.
        *  @param  n  The number of elements to initially create.
        *  @param  value  An element to copy.
+       *  @param  a  An allocator.
        *
        *  This constructor fills the %vector with @a n copies of @a value.
        */
@@ -229,10 +243,24 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
                                      _M_get_Tp_allocator());
       }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  %Vector move constructor.
+       *  @param  x  A %vector of identical element and allocator types.
+       *
+       *  The newly-created %vector contains the exact contents of @a x.
+       *  The contents of @a x are a valid, but unspecified %vector.
+       */
+      vector(vector&& __x)
+      : _Base(__x._M_get_Tp_allocator())
+      { this->swap(__x); }
+#endif
+
       /**
        *  @brief  Builds a %vector from a range.
        *  @param  first  An input iterator.
        *  @param  last  An input iterator.
+       *  @param  a  An allocator.
        *
        *  Create a %vector consisting of copies of the elements from
        *  [first,last).
@@ -275,6 +303,22 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       vector&
       operator=(const vector& __x);
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  %Vector move assignment operator.
+       *  @param  x  A %vector of identical element and allocator types.
+       *
+       *  The contents of @a x are moved into this %vector (without copying).
+       *  @a x is a valid, but unspecified %vector.
+       */
+      vector&
+      operator=(vector&& __x)
+      { 
+       this->swap(__x); 
+       return *this;
+      }
+#endif
+
       /**
        *  @brief  Assigns a given value to a %vector.
        *  @param  n  Number of elements to be assigned.
@@ -721,7 +765,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  std::swap(v1,v2) will feed to this function.
        */
       void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      swap(vector&& __x)
+#else
       swap(vector& __x)
+#endif
       {
        std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
        std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
@@ -1006,6 +1054,18 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
     swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
     { __x.swap(__y); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+  template<typename _Tp, typename _Alloc>
+    inline void
+    swap(vector<_Tp, _Alloc>&& __x, vector<_Tp, _Alloc>& __y)
+    { __x.swap(__y); }
+
+  template<typename _Tp, typename _Alloc>
+    inline void
+    swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>&& __y)
+    { __x.swap(__y); }
+#endif
+
 _GLIBCXX_END_NESTED_NAMESPACE
 
 #endif /* _STL_VECTOR_H */
index 0c47da040331d6132d13df3c835f7c0fcdeef584..8fde473dc7ac47b4f12a7fd217828b935462be00 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1297 }
+// { dg-error "no matching" "" { target *-*-* } 1349 }
 // { dg-excess-errors "" }
 
 #include <deque>
index fc0beffae3ee7f8aeb88bd84d40746936e948fda..3124e19af270d76f02a87a199bd87712f16e4b27 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1232 }
+// { dg-error "no matching" "" { target *-*-* } 1284 }
 // { dg-excess-errors "" }
 
 #include <deque>
index 403f6473f6b22ec094ff46c57948f2cf491eb8fb..1f6115c5d3ceddaa7a04c6ad89a4fd5b678371a2 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1232 }
+// { dg-error "no matching" "" { target *-*-* } 1284 }
 // { dg-excess-errors "" }
 
 #include <deque>
index 2e2abc56c4b62c221c7192766a7c80420fa68bef..9d6365932dd62827a752dd119fa01aa998e26e52 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1377 }
+// { dg-error "no matching" "" { target *-*-* } 1429 }
 // { dg-excess-errors "" }
 
 #include <deque>
index 4ad1127b9e57a66b1603856c49938ba6d9083754..ccabf384ead5407ed8effa386f12df44a85df56c 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1138 }
+// { dg-error "no matching" "" { target *-*-* } 1188 }
 // { dg-excess-errors "" }
 
 #include <list>
index 5df6fc8532c9a530dd0b2e16a53750811cc6eb5a..0711505092fd31970b746f31245049dea883e0ea 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1107 }
+// { dg-error "no matching" "" { target *-*-* } 1157 }
 // { dg-excess-errors "" }
 
 #include <list>
index 6783727be7a403ad1507721789919c343b5ff4bd..1e02ca8913ef576cef7b9f9dfb7d7b8f2cf58275 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1107 }
+// { dg-error "no matching" "" { target *-*-* } 1157 }
 // { dg-excess-errors "" }
 
 #include <list>
index c8f2026052e761ba23c4d87a461bed19bfce0009..04b3c2b95c207083c85cb65f07b08ed85e133dde 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1107 }
+// { dg-error "no matching" "" { target *-*-* } 1157 }
 // { dg-excess-errors "" }
 
 #include <list>
index 609511f07ce165bd1dba1d7d651dbc1727fe0edc..4239d4df3c55da648747809729f01fecf53077ce 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 847 }
+// { dg-error "no matching" "" { target *-*-* } 895 }
 // { dg-excess-errors "" }
 
 #include <vector>
index 12aa0aea6952a840e22294ae3a4ca09bf1650d24..7faf1e2feb6e419d16420beb1d5cc6de9df5fc07 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 787 }
+// { dg-error "no matching" "" { target *-*-* } 835 }
 // { dg-excess-errors "" }
 
 #include <vector>
index 1dd8d305e2e48ce1537a420bd40838921f45663c..66c0206044e47cdfa3e8be2a1922b3cb13aa0424 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 787 }
+// { dg-error "no matching" "" { target *-*-* } 835 }
 // { dg-excess-errors "" }
 
 #include <vector>
index 707776debc9cff0cec6edf18a82fdc4eb974ff46..6aae607479f1684656aae01cf570aebb6f21b66e 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 888 }
+// { dg-error "no matching" "" { target *-*-* } 936 }
 // { dg-excess-errors "" }
 
 #include <vector>