From 41854acbb6be2042f64f275154a9a4bf194e8bf4 Mon Sep 17 00:00:00 2001 From: paolo Date: Sun, 7 Oct 2007 16:33:59 +0000 Subject: [PATCH] 2007-10-07 Chris Jefferson Paolo Carlini * include/debug/list (list<>::list(list&&), list<>::operator=(list&&)): Add. (list<>::swap): Adjust. (swap(list&&, list& __y), swap(list&, list&& __y)): Add. * include/debug/vector (vector<>::vector(vector&&), vector<>::operator=(vector&&)): Add. (vector<>::swap): Adjust. (swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add. * include/debug/deque (deque<>::deque(deque&&), deque<>::operator=(deque&&)): Add. (deque<>::swap): Adjust. (swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add. * include/debug/set.h (set<>::set(set&&), set<>::operator=(set&&)): Add. (set<>::swap): Adjust. (swap(set&&, set& __y), swap(set&, set&& __y)): Add. * include/debug/map.h (map<>::map(map&&), map<>::operator=(map&&)): Add. (map<>::swap): Adjust. (swap(map&&, map& __y), swap(map&, map&& __y)): Add. * include/debug/multiset.h (multiset<>::multiset(multiset&&), multiset<>::operator=(multiset&&)): Add. (smultiet<>::swap): Adjust. (swap(multiset&&, multiset& __y), swap(multiset&, multiset&& __y)): Add. * include/debug/multimap.h (multimap<>::multimap(multimap&&), multimap<>::operator=(multimap&&)): Add. (multimap<>::swap): Adjust. (swap(multimap&&, multimap& __y), swap(multimap&, multimap&& __y)): Add. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129071 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 34 ++++++++++++ libstdc++-v3/include/debug/deque | 52 ++++++++++++++--- libstdc++-v3/include/debug/list | 58 ++++++++++++++++--- libstdc++-v3/include/debug/map.h | 98 ++++++++++++++++++++++++--------- libstdc++-v3/include/debug/multimap.h | 101 ++++++++++++++++++++++++---------- libstdc++-v3/include/debug/multiset.h | 75 ++++++++++++++++++------- libstdc++-v3/include/debug/set.h | 77 +++++++++++++++++++------- libstdc++-v3/include/debug/vector | 45 +++++++++++++-- 8 files changed, 422 insertions(+), 118 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 6bc6711..356b8d1b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,37 @@ +2007-10-07 Chris Jefferson + Paolo Carlini + + * include/debug/list (list<>::list(list&&), + list<>::operator=(list&&)): Add. + (list<>::swap): Adjust. + (swap(list&&, list& __y), swap(list&, list&& __y)): Add. + * include/debug/vector (vector<>::vector(vector&&), + vector<>::operator=(vector&&)): Add. + (vector<>::swap): Adjust. + (swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add. + * include/debug/deque (deque<>::deque(deque&&), + deque<>::operator=(deque&&)): Add. + (deque<>::swap): Adjust. + (swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add. + * include/debug/set.h (set<>::set(set&&), + set<>::operator=(set&&)): Add. + (set<>::swap): Adjust. + (swap(set&&, set& __y), swap(set&, set&& __y)): Add. + * include/debug/map.h (map<>::map(map&&), + map<>::operator=(map&&)): Add. + (map<>::swap): Adjust. + (swap(map&&, map& __y), swap(map&, map&& __y)): Add. + * include/debug/multiset.h (multiset<>::multiset(multiset&&), + multiset<>::operator=(multiset&&)): Add. + (smultiet<>::swap): Adjust. + (swap(multiset&&, multiset& __y), + swap(multiset&, multiset&& __y)): Add. + * include/debug/multimap.h (multimap<>::multimap(multimap&&), + multimap<>::operator=(multimap&&)): Add. + (multimap<>::swap): Adjust. + (swap(multimap&&, multimap& __y), + swap(multimap&, multimap&& __y)): Add. + 2007-10-07 Paolo Carlini * include/bits/stl_algobase.h (_GLIBCXX_MOVE): Add. diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque index 2bf4a19..56db8ee 100644 --- a/libstdc++-v3/include/debug/deque +++ b/libstdc++-v3/include/debug/deque @@ -1,6 +1,6 @@ // Debugging deque implementation -*- C++ -*- -// Copyright (C) 2003, 2004, 2005 +// Copyright (C) 2003, 2004, 2005, 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -84,20 +84,37 @@ namespace __debug : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __a) { } - deque(const deque<_Tp,_Allocator>& __x) : _Base(__x), _Safe_base() { } + deque(const deque& __x) + : _Base(__x), _Safe_base() { } - deque(const _Base& __x) : _Base(__x), _Safe_base() { } + deque(const _Base& __x) + : _Base(__x), _Safe_base() { } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + deque(deque&& __x) + : _Base(__x), _Safe_base() + { this->_M_swap(__x); } +#endif ~deque() { } - deque<_Tp,_Allocator>& - operator=(const deque<_Tp,_Allocator>& __x) + deque& + operator=(const deque& __x) { *static_cast<_Base*>(this) = __x; this->_M_invalidate_all(); return *this; } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + deque& + operator=(deque&& __x) + { + swap(__x); + return *this; + } +#endif + template void assign(_InputIterator __first, _InputIterator __last) @@ -329,7 +346,11 @@ namespace __debug } void - swap(deque<_Tp,_Allocator>& __x) +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + swap(deque&& __x) +#else + swap(deque& __x) +#endif { _Base::swap(__x); this->_M_swap(__x); @@ -363,7 +384,8 @@ namespace __debug template inline bool - operator<(const deque<_Tp, _Alloc>& __lhs, const deque<_Tp, _Alloc>& __rhs) + operator<(const deque<_Tp, _Alloc>& __lhs, + const deque<_Tp, _Alloc>& __rhs) { return __lhs._M_base() < __rhs._M_base(); } template @@ -380,13 +402,27 @@ namespace __debug template inline bool - operator>(const deque<_Tp, _Alloc>& __lhs, const deque<_Tp, _Alloc>& __rhs) + operator>(const deque<_Tp, _Alloc>& __lhs, + const deque<_Tp, _Alloc>& __rhs) { return __lhs._M_base() > __rhs._M_base(); } template inline void swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>& __rhs) { __lhs.swap(__rhs); } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template + inline void + swap(deque<_Tp, _Alloc>&& __lhs, deque<_Tp, _Alloc>& __rhs) + { __lhs.swap(__rhs); } + + template + inline void + swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>&& __rhs) + { __lhs.swap(__rhs); } +#endif + } // namespace __debug } // namespace std diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list index 485df08..f30917b2 100644 --- a/libstdc++-v3/include/debug/list +++ b/libstdc++-v3/include/debug/list @@ -1,6 +1,6 @@ // Debugging list implementation -*- C++ -*- -// Copyright (C) 2003, 2004, 2005, 2006 +// Copyright (C) 2003, 2004, 2005, 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -113,9 +113,17 @@ namespace __debug { } - list(const list& __x) : _Base(__x), _Safe_base() { } + list(const list& __x) + : _Base(__x), _Safe_base() { } - list(const _Base& __x) : _Base(__x), _Safe_base() { } + list(const _Base& __x) + : _Base(__x), _Safe_base() { } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + list(list&& __x) + : _Base(__x), _Safe_base() + { this->_M_swap(__x); } +#endif ~list() { } @@ -127,6 +135,15 @@ namespace __debug return *this; } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + list& + operator=(list&& __x) + { + swap(__x); + return *this; + } +#endif + template void assign(_InputIterator __first, _InputIterator __last) @@ -311,7 +328,11 @@ namespace __debug } void +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + swap(list&& __x) +#else swap(list& __x) +#endif { _Base::swap(__x); this->_M_swap(__x); @@ -502,38 +523,57 @@ namespace __debug template inline bool - operator==(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs) + operator==(const list<_Tp, _Alloc>& __lhs, + const list<_Tp, _Alloc>& __rhs) { return __lhs._M_base() == __rhs._M_base(); } template inline bool - operator!=(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs) + operator!=(const list<_Tp, _Alloc>& __lhs, + const list<_Tp, _Alloc>& __rhs) { return __lhs._M_base() != __rhs._M_base(); } template inline bool - operator<(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs) + operator<(const list<_Tp, _Alloc>& __lhs, + const list<_Tp, _Alloc>& __rhs) { return __lhs._M_base() < __rhs._M_base(); } template inline bool - operator<=(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs) + operator<=(const list<_Tp, _Alloc>& __lhs, + const list<_Tp, _Alloc>& __rhs) { return __lhs._M_base() <= __rhs._M_base(); } template inline bool - operator>=(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs) + operator>=(const list<_Tp, _Alloc>& __lhs, + const list<_Tp, _Alloc>& __rhs) { return __lhs._M_base() >= __rhs._M_base(); } template inline bool - operator>(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs) + operator>(const list<_Tp, _Alloc>& __lhs, + const list<_Tp, _Alloc>& __rhs) { return __lhs._M_base() > __rhs._M_base(); } template inline void swap(list<_Tp, _Alloc>& __lhs, list<_Tp, _Alloc>& __rhs) { __lhs.swap(__rhs); } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template + inline void + swap(list<_Tp, _Alloc>&& __lhs, list<_Tp, _Alloc>& __rhs) + { __lhs.swap(__rhs); } + + template + inline void + swap(list<_Tp, _Alloc>& __lhs, list<_Tp, _Alloc>&& __rhs) + { __lhs.swap(__rhs); } +#endif + } // namespace __debug } // namespace std diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h index d619520..5e1312a 100644 --- a/libstdc++-v3/include/debug/map.h +++ b/libstdc++-v3/include/debug/map.h @@ -1,6 +1,6 @@ // Debugging map implementation -*- C++ -*- -// Copyright (C) 2003, 2004, 2005 +// Copyright (C) 2003, 2004, 2005, 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -88,21 +88,37 @@ namespace __debug : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __comp, __a), _Safe_base() { } - map(const map<_Key,_Tp,_Compare,_Allocator>& __x) + map(const map& __x) : _Base(__x), _Safe_base() { } - map(const _Base& __x) : _Base(__x), _Safe_base() { } + map(const _Base& __x) + : _Base(__x), _Safe_base() { } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + map(map&& __x) + : _Base(__x), _Safe_base() + { this->_M_swap(__x); } +#endif ~map() { } - map<_Key,_Tp,_Compare,_Allocator>& - operator=(const map<_Key,_Tp,_Compare,_Allocator>& __x) + map& + operator=(const map& __x) { *static_cast<_Base*>(this) = __x; this->_M_invalidate_all(); return *this; } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + map& + operator=(map&& __x) + { + swap(__x); + return *this; + } +#endif + // _GLIBCXX_RESOLVE_LIB_DEFECTS // 133. map missing get_allocator() using _Base::get_allocator; @@ -210,7 +226,11 @@ namespace __debug } void - swap(map<_Key,_Tp,_Compare,_Allocator>& __x) +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + swap(map&& __x) +#else + swap(map& __x) +#endif { _Base::swap(__x); this->_M_swap(__x); @@ -287,47 +307,71 @@ namespace __debug } }; - template + template inline bool - operator==(const map<_Key,_Tp,_Compare,_Allocator>& __lhs, - const map<_Key,_Tp,_Compare,_Allocator>& __rhs) + operator==(const map<_Key, _Tp, _Compare, _Allocator>& __lhs, + const map<_Key, _Tp, _Compare, _Allocator>& __rhs) { return __lhs._M_base() == __rhs._M_base(); } - template + template inline bool - operator!=(const map<_Key,_Tp,_Compare,_Allocator>& __lhs, - const map<_Key,_Tp,_Compare,_Allocator>& __rhs) + operator!=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs, + const map<_Key, _Tp, _Compare, _Allocator>& __rhs) { return __lhs._M_base() != __rhs._M_base(); } - template + template inline bool - operator<(const map<_Key,_Tp,_Compare,_Allocator>& __lhs, - const map<_Key,_Tp,_Compare,_Allocator>& __rhs) + operator<(const map<_Key, _Tp, _Compare, _Allocator>& __lhs, + const map<_Key, _Tp, _Compare, _Allocator>& __rhs) { return __lhs._M_base() < __rhs._M_base(); } - template + template inline bool - operator<=(const map<_Key,_Tp,_Compare,_Allocator>& __lhs, - const map<_Key,_Tp,_Compare,_Allocator>& __rhs) + operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs, + const map<_Key, _Tp, _Compare, _Allocator>& __rhs) { return __lhs._M_base() <= __rhs._M_base(); } - template + template inline bool - operator>=(const map<_Key,_Tp,_Compare,_Allocator>& __lhs, - const map<_Key,_Tp,_Compare,_Allocator>& __rhs) + operator>=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs, + const map<_Key, _Tp, _Compare, _Allocator>& __rhs) { return __lhs._M_base() >= __rhs._M_base(); } - template + template inline bool - operator>(const map<_Key,_Tp,_Compare,_Allocator>& __lhs, - const map<_Key,_Tp,_Compare,_Allocator>& __rhs) + operator>(const map<_Key, _Tp, _Compare, _Allocator>& __lhs, + const map<_Key, _Tp, _Compare, _Allocator>& __rhs) { return __lhs._M_base() > __rhs._M_base(); } - template + template inline void - swap(map<_Key,_Tp,_Compare,_Allocator>& __lhs, - map<_Key,_Tp,_Compare,_Allocator>& __rhs) + swap(map<_Key, _Tp, _Compare, _Allocator>& __lhs, + map<_Key, _Tp, _Compare, _Allocator>& __rhs) { __lhs.swap(__rhs); } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template + inline void + swap(map<_Key, _Tp, _Compare, _Allocator>&& __lhs, + map<_Key, _Tp, _Compare, _Allocator>& __rhs) + { __lhs.swap(__rhs); } + + template + inline void + swap(map<_Key, _Tp, _Compare, _Allocator>& __lhs, + map<_Key, _Tp, _Compare, _Allocator>&& __rhs) + { __lhs.swap(__rhs); } +#endif + } // namespace __debug } // namespace std diff --git a/libstdc++-v3/include/debug/multimap.h b/libstdc++-v3/include/debug/multimap.h index 5e4962f..4f0b793 100644 --- a/libstdc++-v3/include/debug/multimap.h +++ b/libstdc++-v3/include/debug/multimap.h @@ -1,6 +1,6 @@ // Debugging multimap implementation -*- C++ -*- -// Copyright (C) 2003, 2004, 2005 +// Copyright (C) 2003, 2004, 2005, 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -47,7 +47,8 @@ namespace __debug typename _Allocator = std::allocator > > class multimap : public _GLIBCXX_STD_D::multimap<_Key, _Tp, _Compare, _Allocator>, - public __gnu_debug::_Safe_sequence > + public __gnu_debug::_Safe_sequence > { typedef _GLIBCXX_STD_D::multimap<_Key, _Tp, _Compare, _Allocator> _Base; typedef __gnu_debug::_Safe_sequence _Safe_base; @@ -88,21 +89,37 @@ namespace __debug : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __comp, __a) { } - multimap(const multimap<_Key,_Tp,_Compare,_Allocator>& __x) + multimap(const multimap& __x) : _Base(__x), _Safe_base() { } - multimap(const _Base& __x) : _Base(__x), _Safe_base() { } + multimap(const _Base& __x) + : _Base(__x), _Safe_base() { } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + multimap(multimap&& __x) + : _Base(__x), _Safe_base() + { this->_M_swap(__x); } +#endif ~multimap() { } - multimap<_Key,_Tp,_Compare,_Allocator>& - operator=(const multimap<_Key,_Tp,_Compare,_Allocator>& __x) + multimap& + operator=(const multimap& __x) { *static_cast<_Base*>(this) = __x; this->_M_invalidate_all(); return *this; } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + multimap& + operator=(multimap&& __x) + { + swap(__x); + return *this; + } +#endif + using _Base::get_allocator; // iterators: @@ -197,7 +214,11 @@ namespace __debug } void - swap(multimap<_Key,_Tp,_Compare,_Allocator>& __x) +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + swap(multimap&& __x) +#else + swap(multimap& __x) +#endif { _Base::swap(__x); this->_M_swap(__x); @@ -274,47 +295,71 @@ namespace __debug } }; - template + template inline bool - operator==(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs, - const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs) + operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs, + const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs) { return __lhs._M_base() == __rhs._M_base(); } - template + template inline bool - operator!=(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs, - const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs) + operator!=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs, + const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs) { return __lhs._M_base() != __rhs._M_base(); } - template + template inline bool - operator<(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs, - const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs) + operator<(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs, + const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs) { return __lhs._M_base() < __rhs._M_base(); } - template + template inline bool - operator<=(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs, - const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs) + operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs, + const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs) { return __lhs._M_base() <= __rhs._M_base(); } - template + template inline bool - operator>=(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs, - const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs) + operator>=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs, + const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs) { return __lhs._M_base() >= __rhs._M_base(); } - template + template inline bool - operator>(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs, - const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs) + operator>(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs, + const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs) { return __lhs._M_base() > __rhs._M_base(); } - template + template inline void - swap(multimap<_Key,_Tp,_Compare,_Allocator>& __lhs, - multimap<_Key,_Tp,_Compare,_Allocator>& __rhs) + swap(multimap<_Key, _Tp, _Compare, _Allocator>& __lhs, + multimap<_Key, _Tp, _Compare, _Allocator>& __rhs) { __lhs.swap(__rhs); } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template + inline void + swap(multimap<_Key, _Tp, _Compare, _Allocator>&& __lhs, + multimap<_Key, _Tp, _Compare, _Allocator>& __rhs) + { __lhs.swap(__rhs); } + + template + inline void + swap(multimap<_Key, _Tp, _Compare, _Allocator>& __lhs, + multimap<_Key, _Tp, _Compare, _Allocator>&& __rhs) + { __lhs.swap(__rhs); } +#endif + } // namespace __debug } // namespace std diff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h index 2ca534a..5ec9945 100644 --- a/libstdc++-v3/include/debug/multiset.h +++ b/libstdc++-v3/include/debug/multiset.h @@ -1,6 +1,6 @@ // Debugging multiset implementation -*- C++ -*- -// Copyright (C) 2003, 2004, 2005 +// Copyright (C) 2003, 2004, 2005, 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -86,21 +86,37 @@ namespace __debug : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __comp, __a) { } - multiset(const multiset<_Key,_Compare,_Allocator>& __x) + multiset(const multiset& __x) : _Base(__x), _Safe_base() { } - multiset(const _Base& __x) : _Base(__x), _Safe_base() { } + multiset(const _Base& __x) + : _Base(__x), _Safe_base() { } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + multiset(multiset&& __x) + : _Base(__x), _Safe_base() + { this->_M_swap(__x); } +#endif ~multiset() { } - multiset<_Key,_Compare,_Allocator>& - operator=(const multiset<_Key,_Compare,_Allocator>& __x) + multiset& + operator=(const multiset& __x) { *static_cast<_Base*>(this) = __x; this->_M_invalidate_all(); return *this; } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + multiset& + operator=(multiset&& __x) + { + swap(__x); + return *this; + } +#endif + using _Base::get_allocator; // iterators: @@ -195,7 +211,11 @@ namespace __debug } void - swap(multiset<_Key,_Compare,_Allocator>& __x) +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + swap(multiset&& __x) +#else + swap(multiset& __x) +#endif { _Base::swap(__x); this->_M_swap(__x); @@ -282,45 +302,60 @@ namespace __debug template inline bool - operator==(const multiset<_Key,_Compare,_Allocator>& __lhs, - const multiset<_Key,_Compare,_Allocator>& __rhs) + operator==(const multiset<_Key, _Compare, _Allocator>& __lhs, + const multiset<_Key, _Compare, _Allocator>& __rhs) { return __lhs._M_base() == __rhs._M_base(); } template inline bool - operator!=(const multiset<_Key,_Compare,_Allocator>& __lhs, - const multiset<_Key,_Compare,_Allocator>& __rhs) + operator!=(const multiset<_Key, _Compare, _Allocator>& __lhs, + const multiset<_Key, _Compare, _Allocator>& __rhs) { return __lhs._M_base() != __rhs._M_base(); } template inline bool - operator<(const multiset<_Key,_Compare,_Allocator>& __lhs, - const multiset<_Key,_Compare,_Allocator>& __rhs) + operator<(const multiset<_Key, _Compare, _Allocator>& __lhs, + const multiset<_Key, _Compare, _Allocator>& __rhs) { return __lhs._M_base() < __rhs._M_base(); } template inline bool - operator<=(const multiset<_Key,_Compare,_Allocator>& __lhs, - const multiset<_Key,_Compare,_Allocator>& __rhs) + operator<=(const multiset<_Key, _Compare, _Allocator>& __lhs, + const multiset<_Key, _Compare, _Allocator>& __rhs) { return __lhs._M_base() <= __rhs._M_base(); } template inline bool - operator>=(const multiset<_Key,_Compare,_Allocator>& __lhs, - const multiset<_Key,_Compare,_Allocator>& __rhs) + operator>=(const multiset<_Key, _Compare, _Allocator>& __lhs, + const multiset<_Key, _Compare, _Allocator>& __rhs) { return __lhs._M_base() >= __rhs._M_base(); } template inline bool - operator>(const multiset<_Key,_Compare,_Allocator>& __lhs, - const multiset<_Key,_Compare,_Allocator>& __rhs) + operator>(const multiset<_Key, _Compare, _Allocator>& __lhs, + const multiset<_Key, _Compare, _Allocator>& __rhs) { return __lhs._M_base() > __rhs._M_base(); } template void - swap(multiset<_Key,_Compare,_Allocator>& __x, - multiset<_Key,_Compare,_Allocator>& __y) + swap(multiset<_Key, _Compare, _Allocator>& __x, + multiset<_Key, _Compare, _Allocator>& __y) { return __x.swap(__y); } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template + void + swap(multiset<_Key, _Compare, _Allocator>&& __x, + multiset<_Key, _Compare, _Allocator>& __y) + { return __x.swap(__y); } + + template + void + swap(multiset<_Key, _Compare, _Allocator>& __x, + multiset<_Key, _Compare, _Allocator>&& __y) + { return __x.swap(__y); } +#endif + } // namespace __debug } // namespace std diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h index d40d319..5610cab 100644 --- a/libstdc++-v3/include/debug/set.h +++ b/libstdc++-v3/include/debug/set.h @@ -1,6 +1,6 @@ // Debugging set implementation -*- C++ -*- -// Copyright (C) 2003, 2004, 2005 +// Copyright (C) 2003, 2004, 2005, 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -49,7 +49,7 @@ namespace __debug : public _GLIBCXX_STD_D::set<_Key,_Compare,_Allocator>, public __gnu_debug::_Safe_sequence > { - typedef _GLIBCXX_STD_D::set<_Key,_Compare,_Allocator> _Base; + typedef _GLIBCXX_STD_D::set<_Key, _Compare, _Allocator> _Base; typedef __gnu_debug::_Safe_sequence _Safe_base; public: @@ -86,21 +86,37 @@ namespace __debug : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __comp, __a) { } - set(const set<_Key,_Compare,_Allocator>& __x) + set(const set& __x) : _Base(__x), _Safe_base() { } - set(const _Base& __x) : _Base(__x), _Safe_base() { } + set(const _Base& __x) + : _Base(__x), _Safe_base() { } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + set(set&& __x) + : _Base(__x), _Safe_base() + { this->_M_swap(__x); } +#endif ~set() { } - set<_Key,_Compare,_Allocator>& - operator=(const set<_Key,_Compare,_Allocator>& __x) + set& + operator=(const set& __x) { *static_cast<_Base*>(this) = __x; this->_M_invalidate_all(); return *this; } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + set& + operator=(set&& __x) + { + swap(__x); + return *this; + } +#endif + using _Base::get_allocator; // iterators: @@ -200,7 +216,11 @@ namespace __debug } void - swap(set<_Key,_Compare,_Allocator>& __x) +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + swap(set&& __x) +#else + swap(set& __x) +#endif { _Base::swap(__x); this->_M_swap(__x); @@ -287,45 +307,60 @@ namespace __debug template inline bool - operator==(const set<_Key,_Compare,_Allocator>& __lhs, - const set<_Key,_Compare,_Allocator>& __rhs) + operator==(const set<_Key, _Compare, _Allocator>& __lhs, + const set<_Key, _Compare, _Allocator>& __rhs) { return __lhs._M_base() == __rhs._M_base(); } template inline bool - operator!=(const set<_Key,_Compare,_Allocator>& __lhs, - const set<_Key,_Compare,_Allocator>& __rhs) + operator!=(const set<_Key, _Compare, _Allocator>& __lhs, + const set<_Key, _Compare, _Allocator>& __rhs) { return __lhs._M_base() != __rhs._M_base(); } template inline bool - operator<(const set<_Key,_Compare,_Allocator>& __lhs, - const set<_Key,_Compare,_Allocator>& __rhs) + operator<(const set<_Key, _Compare, _Allocator>& __lhs, + const set<_Key, _Compare, _Allocator>& __rhs) { return __lhs._M_base() < __rhs._M_base(); } template inline bool - operator<=(const set<_Key,_Compare,_Allocator>& __lhs, - const set<_Key,_Compare,_Allocator>& __rhs) + operator<=(const set<_Key, _Compare, _Allocator>& __lhs, + const set<_Key, _Compare, _Allocator>& __rhs) { return __lhs._M_base() <= __rhs._M_base(); } template inline bool - operator>=(const set<_Key,_Compare,_Allocator>& __lhs, - const set<_Key,_Compare,_Allocator>& __rhs) + operator>=(const set<_Key, _Compare, _Allocator>& __lhs, + const set<_Key, _Compare, _Allocator>& __rhs) { return __lhs._M_base() >= __rhs._M_base(); } template inline bool - operator>(const set<_Key,_Compare,_Allocator>& __lhs, - const set<_Key,_Compare,_Allocator>& __rhs) + operator>(const set<_Key, _Compare, _Allocator>& __lhs, + const set<_Key, _Compare, _Allocator>& __rhs) { return __lhs._M_base() > __rhs._M_base(); } template void - swap(set<_Key,_Compare,_Allocator>& __x, - set<_Key,_Compare,_Allocator>& __y) + swap(set<_Key, _Compare, _Allocator>& __x, + set<_Key, _Compare, _Allocator>& __y) { return __x.swap(__y); } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template + void + swap(set<_Key, _Compare, _Allocator>&& __x, + set<_Key, _Compare, _Allocator>& __y) + { return __x.swap(__y); } + + template + void + swap(set<_Key, _Compare, _Allocator>& __x, + set<_Key, _Compare, _Allocator>&& __y) + { return __x.swap(__y); } +#endif + } // namespace __debug } // namespace std diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector index 1365525..91e515a 100644 --- a/libstdc++-v3/include/debug/vector +++ b/libstdc++-v3/include/debug/vector @@ -1,6 +1,6 @@ // Debugging vector implementation -*- C++ -*- -// Copyright (C) 2003, 2004, 2005 +// Copyright (C) 2003, 2004, 2005, 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -91,17 +91,26 @@ namespace __debug _M_guaranteed_capacity(0) { _M_update_guaranteed_capacity(); } - vector(const vector<_Tp,_Allocator>& __x) + vector(const vector& __x) : _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { } /// Construction from a release-mode vector vector(const _Base& __x) : _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + vector(vector&& __x) + : _Base(__x), _Safe_base(), _M_guaranteed_capacity(this->size()) + { + this->_M_swap(__x); + __x._M_guaranteed_capacity = 0; + } +#endif + ~vector() { } - vector<_Tp,_Allocator>& - operator=(const vector<_Tp,_Allocator>& __x) + vector& + operator=(const vector& __x) { static_cast<_Base&>(*this) = __x; this->_M_invalidate_all(); @@ -109,6 +118,15 @@ namespace __debug return *this; } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + vector& + operator=(vector&& __x) + { + swap(__x); + return *this; + } +#endif + template void assign(_InputIterator __first, _InputIterator __last) @@ -335,7 +353,11 @@ namespace __debug } void - swap(vector<_Tp,_Allocator>& __x) +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + swap(vector&& __x) +#else + swap(vector& __x) +#endif { _Base::swap(__x); this->_M_swap(__x); @@ -417,6 +439,19 @@ namespace __debug inline void swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>& __rhs) { __lhs.swap(__rhs); } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template + inline void + swap(vector<_Tp, _Alloc>&& __lhs, vector<_Tp, _Alloc>& __rhs) + { __lhs.swap(__rhs); } + + template + inline void + swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>&& __rhs) + { __lhs.swap(__rhs); } +#endif + } // namespace __debug } // namespace std -- 2.7.4