diff options
| author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-07 16:33:59 +0000 |
|---|---|---|
| committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-07 16:33:59 +0000 |
| commit | 41854acbb6be2042f64f275154a9a4bf194e8bf4 (patch) | |
| tree | 128bbf6e1b1bc763832380081aa55ef3bc358778 /libstdc++-v3/include/debug/vector | |
| parent | 18155f9b8ef77803a76041d0b424a59a614a28b4 (diff) | |
| download | ppe42-gcc-41854acbb6be2042f64f275154a9a4bf194e8bf4.tar.gz ppe42-gcc-41854acbb6be2042f64f275154a9a4bf194e8bf4.zip | |
2007-10-07 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* 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
Diffstat (limited to 'libstdc++-v3/include/debug/vector')
| -rw-r--r-- | libstdc++-v3/include/debug/vector | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector index 1365525fef2..91e515a8e9b 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<typename _InputIterator> 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<typename _Tp, typename _Alloc> + inline void + swap(vector<_Tp, _Alloc>&& __lhs, vector<_Tp, _Alloc>& __rhs) + { __lhs.swap(__rhs); } + + template<typename _Tp, typename _Alloc> + inline void + swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>&& __rhs) + { __lhs.swap(__rhs); } +#endif + } // namespace __debug } // namespace std |

