aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely.gcc@gmail.com>2009-05-18 22:15:56 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2009-05-18 23:15:56 +0100
commitff74fd1325ef58c09af1b294338321df2f6b97f0 (patch)
tree9e5d3130d10e286ff2c08e48302f54620ec6707d /libstdc++-v3
parente57d93c6bcfd50cdb3d1928d78e8fe0bb6ce517c (diff)
downloadgcc-ff74fd1325ef58c09af1b294338321df2f6b97f0.zip
gcc-ff74fd1325ef58c09af1b294338321df2f6b97f0.tar.gz
gcc-ff74fd1325ef58c09af1b294338321df2f6b97f0.tar.bz2
stl_pair.h (swap): Do not swap rvalues.
2009-05-18 Jonathan Wakely <jwakely.gcc@gmail.com> * include/bits/stl_pair.h (swap): Do not swap rvalues. * include/bits/stl_deque.h (swap): Likewise. * include/bits/stl_list.h (swap): Likewise. * include/bits/stl_vector.h (swap): Likewise. * include/bits/stl_bvector.h (swap): Likewise. * include/bits/stl_queue.h (swap): Likewise. * include/bits/stl_stack.h (swap): Likewise. * include/bits/stl_tree.h (swap): Likewise. * include/bits/stl_map.h (swap): Likewise. * include/bits/stl_multimap.h (swap): Likewise. * include/bits/stl_set.h (swap): Likewise. * include/bits/stl_multiset.h (swap): Likewise. * include/bits/forward_list.h (swap): Likewise. * include/bits/unique_ptr.h (swap): Likewise. * include/debug/deque (swap): Likewise. * include/debug/list (swap): Likewise. * include/debug/vector (swap): Likewise. * include/debug/map.h (swap): Likewise. * include/debug/multimap.h (swap): Likewise. * include/debug/set.h (swap): Likewise. * include/debug/multiset.h (swap): Likewise. * include/debug/unordered_map (swap): Likewise. * include/debug/unordered_set (swap): Likewise. * include/ext/vstring.h (swap): Likewise. * include/tr1_impl/unordered_map (swap): Likewise. * include/tr1_impl/hashtable (swap): Likewise. * include/tr1_impl/unordered_set (swap): Likewise. * include/std/tuple (swap): Likewise. * include/std/mutex (swap): Likewise. * include/std/thread (swap): Likewise. (operator<<): Only output to lvalue streams. * testsuite/20_util/shared_ptr/modifiers/swap_rvalue.cc: Remove. * testsuite/23_containers/headers/forward_list/synopsis.cc: Adjust. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Adjust line numbers. * 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/deque/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ assign_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. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_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/vector/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/30_threads/thread/swap/1.cc: Swap with lvalue and also test non-member swap. * testsuite/30_threads/thread/swap/2.cc: Remove. From-SVN: r147678
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog65
-rw-r--r--libstdc++-v3/include/bits/forward_list.h16
-rw-r--r--libstdc++-v3/include/bits/stl_bvector.h4
-rw-r--r--libstdc++-v3/include/bits/stl_deque.h16
-rw-r--r--libstdc++-v3/include/bits/stl_list.h16
-rw-r--r--libstdc++-v3/include/bits/stl_map.h18
-rw-r--r--libstdc++-v3/include/bits/stl_multimap.h18
-rw-r--r--libstdc++-v3/include/bits/stl_multiset.h18
-rw-r--r--libstdc++-v3/include/bits/stl_pair.h12
-rw-r--r--libstdc++-v3/include/bits/stl_queue.h26
-rw-r--r--libstdc++-v3/include/bits/stl_set.h16
-rw-r--r--libstdc++-v3/include/bits/stl_stack.h12
-rw-r--r--libstdc++-v3/include/bits/stl_tree.h8
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h16
-rw-r--r--libstdc++-v3/include/bits/unique_ptr.h16
-rw-r--r--libstdc++-v3/include/debug/deque16
-rw-r--r--libstdc++-v3/include/debug/list16
-rw-r--r--libstdc++-v3/include/debug/map.h20
-rw-r--r--libstdc++-v3/include/debug/multimap.h20
-rw-r--r--libstdc++-v3/include/debug/multiset.h18
-rw-r--r--libstdc++-v3/include/debug/set.h18
-rw-r--r--libstdc++-v3/include/debug/unordered_map32
-rw-r--r--libstdc++-v3/include/debug/unordered_set28
-rw-r--r--libstdc++-v3/include/debug/vector16
-rw-r--r--libstdc++-v3/include/ext/vstring.h20
-rw-r--r--libstdc++-v3/include/std/mutex12
-rw-r--r--libstdc++-v3/include/std/thread14
-rw-r--r--libstdc++-v3/include/std/tuple24
-rw-r--r--libstdc++-v3/include/tr1_impl/hashtable8
-rw-r--r--libstdc++-v3/include/tr1_impl/unordered_map26
-rw-r--r--libstdc++-v3/include/tr1_impl/unordered_set26
-rw-r--r--libstdc++-v3/testsuite/20_util/shared_ptr/modifiers/swap_rvalue.cc47
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/headers/forward_list/synopsis.cc6
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/swap/1.cc39
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/swap/2.cc112
47 files changed, 134 insertions, 685 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index ea4b256..29c4805 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,4 +1,67 @@
-2009-05-13 Jonathan Wakely <jwakely.gcc@gmail.com>
+2009-05-18 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * include/bits/stl_pair.h (swap): Do not swap rvalues.
+ * include/bits/stl_deque.h (swap): Likewise.
+ * include/bits/stl_list.h (swap): Likewise.
+ * include/bits/stl_vector.h (swap): Likewise.
+ * include/bits/stl_bvector.h (swap): Likewise.
+ * include/bits/stl_queue.h (swap): Likewise.
+ * include/bits/stl_stack.h (swap): Likewise.
+ * include/bits/stl_tree.h (swap): Likewise.
+ * include/bits/stl_map.h (swap): Likewise.
+ * include/bits/stl_multimap.h (swap): Likewise.
+ * include/bits/stl_set.h (swap): Likewise.
+ * include/bits/stl_multiset.h (swap): Likewise.
+ * include/bits/forward_list.h (swap): Likewise.
+ * include/bits/unique_ptr.h (swap): Likewise.
+ * include/debug/deque (swap): Likewise.
+ * include/debug/list (swap): Likewise.
+ * include/debug/vector (swap): Likewise.
+ * include/debug/map.h (swap): Likewise.
+ * include/debug/multimap.h (swap): Likewise.
+ * include/debug/set.h (swap): Likewise.
+ * include/debug/multiset.h (swap): Likewise.
+ * include/debug/unordered_map (swap): Likewise.
+ * include/debug/unordered_set (swap): Likewise.
+ * include/ext/vstring.h (swap): Likewise.
+ * include/tr1_impl/unordered_map (swap): Likewise.
+ * include/tr1_impl/hashtable (swap): Likewise.
+ * include/tr1_impl/unordered_set (swap): Likewise.
+ * include/std/tuple (swap): Likewise.
+ * include/std/mutex (swap): Likewise.
+ * include/std/thread (swap): Likewise.
+ (operator<<): Only output to lvalue streams.
+ * testsuite/20_util/shared_ptr/modifiers/swap_rvalue.cc: Remove.
+ * testsuite/23_containers/headers/forward_list/synopsis.cc: Adjust.
+ * testsuite/23_containers/deque/requirements/dr438/
+ assign_neg.cc: Adjust line numbers.
+ * 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/deque/requirements/dr438/
+ insert_neg.cc: Likewise.
+ * testsuite/23_containers/list/requirements/dr438/
+ assign_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.
+ * testsuite/23_containers/list/requirements/dr438/
+ insert_neg.cc: Likewise.
+ * testsuite/23_containers/vector/requirements/dr438/
+ assign_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/vector/requirements/dr438/
+ insert_neg.cc: Likewise.
+ * testsuite/30_threads/thread/swap/1.cc: Swap with lvalue and also
+ test non-member swap.
+ * testsuite/30_threads/thread/swap/2.cc: Remove.
+
+2009-05-16 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/std/mutex: Move std::lock_error to ...
* src/compatibility.cc: Here.
diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h
index d49eb4a..724d87b 100644
--- a/libstdc++-v3/include/bits/forward_list.h
+++ b/libstdc++-v3/include/bits/forward_list.h
@@ -983,7 +983,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* function.
*/
void
- swap(forward_list&& __list)
+ swap(forward_list& __list)
{ _Node_base::swap(this->_M_impl._M_head, __list._M_impl._M_head); }
/**
@@ -1285,20 +1285,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
forward_list<_Tp, _Alloc>& __ly)
{ __lx.swap(__ly); }
- /// See std::forward_list::swap().
- template<typename _Tp, typename _Alloc>
- inline void
- swap(forward_list<_Tp, _Alloc>&& __lx,
- forward_list<_Tp, _Alloc>& __ly)
- { __lx.swap(__ly); }
-
- /// See std::forward_list::swap().
- template<typename _Tp, typename _Alloc>
- inline void
- swap(forward_list<_Tp, _Alloc>& __lx,
- forward_list<_Tp, _Alloc>&& __ly)
- { __lx.swap(__ly); }
-
_GLIBCXX_END_NAMESPACE // namespace std
#endif // __GXX_EXPERIMENTAL_CXX0X__
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index 0e60b7f..87dbb0b 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -743,11 +743,7 @@ template<typename _Alloc>
}
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);
diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h
index 1c20e27..7f601cb 100644
--- a/libstdc++-v3/include/bits/stl_deque.h
+++ b/libstdc++-v3/include/bits/stl_deque.h
@@ -1395,11 +1395,7 @@ _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);
@@ -1802,18 +1798,6 @@ _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 */
diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h
index bba1f53..f758bae 100644
--- a/libstdc++-v3/include/bits/stl_list.h
+++ b/libstdc++-v3/include/bits/stl_list.h
@@ -1106,11 +1106,7 @@ _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);
@@ -1516,18 +1512,6 @@ _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 */
diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h
index 90e5239..5416d82 100644
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -608,11 +608,7 @@ _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); }
/**
@@ -852,20 +848,6 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
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 */
diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h
index 484537c..91dcfa6 100644
--- a/libstdc++-v3/include/bits/stl_multimap.h
+++ b/libstdc++-v3/include/bits/stl_multimap.h
@@ -544,11 +544,7 @@ _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); }
/**
@@ -781,20 +777,6 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
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 */
diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h
index b5c710f..be9e248 100644
--- a/libstdc++-v3/include/bits/stl_multiset.h
+++ b/libstdc++-v3/include/bits/stl_multiset.h
@@ -376,11 +376,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
* std::swap(s1,s2) will feed to this function.
*/
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(multiset&& __x)
-#else
swap(multiset& __x)
-#endif
{ _M_t.swap(__x._M_t); }
// insert/erase
@@ -678,20 +674,6 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
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 */
diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h
index fd395ad..d6c5901 100644
--- a/libstdc++-v3/include/bits/stl_pair.h
+++ b/libstdc++-v3/include/bits/stl_pair.h
@@ -131,7 +131,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
}
void
- swap(pair&& __p)
+ swap(pair& __p)
{
using std::swap;
swap(first, __p.first);
@@ -185,16 +185,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
inline void
swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
{ __x.swap(__y); }
-
- template<class _T1, class _T2>
- inline void
- swap(pair<_T1, _T2>&& __x, pair<_T1, _T2>& __y)
- { __x.swap(__y); }
-
- template<class _T1, class _T2>
- inline void
- swap(pair<_T1, _T2>& __x, pair<_T1, _T2>&& __y)
- { __x.swap(__y); }
#endif
/**
diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h
index 7479469..61149c4 100644
--- a/libstdc++-v3/include/bits/stl_queue.h
+++ b/libstdc++-v3/include/bits/stl_queue.h
@@ -249,7 +249,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#ifdef __GXX_EXPERIMENTAL_CXX0X__
void
- swap(queue&& __q)
+ swap(queue& __q)
{ c.swap(__q.c); }
#endif
};
@@ -317,16 +317,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
inline void
swap(queue<_Tp, _Seq>& __x, queue<_Tp, _Seq>& __y)
{ __x.swap(__y); }
-
- template<typename _Tp, typename _Seq>
- inline void
- swap(queue<_Tp, _Seq>&& __x, queue<_Tp, _Seq>& __y)
- { __x.swap(__y); }
-
- template<typename _Tp, typename _Seq>
- inline void
- swap(queue<_Tp, _Seq>& __x, queue<_Tp, _Seq>&& __y)
- { __x.swap(__y); }
#endif
/**
@@ -550,7 +540,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#ifdef __GXX_EXPERIMENTAL_CXX0X__
void
- swap(priority_queue&& __pq)
+ swap(priority_queue& __pq)
{
using std::swap;
c.swap(__pq.c);
@@ -567,18 +557,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
swap(priority_queue<_Tp, _Sequence, _Compare>& __x,
priority_queue<_Tp, _Sequence, _Compare>& __y)
{ __x.swap(__y); }
-
- template<typename _Tp, typename _Sequence, typename _Compare>
- inline void
- swap(priority_queue<_Tp, _Sequence, _Compare>&& __x,
- priority_queue<_Tp, _Sequence, _Compare>& __y)
- { __x.swap(__y); }
-
- template<typename _Tp, typename _Sequence, typename _Compare>
- inline void
- swap(priority_queue<_Tp, _Sequence, _Compare>& __x,
- priority_queue<_Tp, _Sequence, _Compare>&& __y)
- { __x.swap(__y); }
#endif
_GLIBCXX_END_NAMESPACE
diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h
index f06fe03..ccd0bc7 100644
--- a/libstdc++-v3/include/bits/stl_set.h
+++ b/libstdc++-v3/include/bits/stl_set.h
@@ -383,11 +383,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
* std::swap(s1,s2) will feed to this function.
*/
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(set&& __x)
-#else
swap(set& __x)
-#endif
{ _M_t.swap(__x._M_t); }
// insert/erase
@@ -691,18 +687,6 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
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 */
diff --git a/libstdc++-v3/include/bits/stl_stack.h b/libstdc++-v3/include/bits/stl_stack.h
index da301d4..4178408 100644
--- a/libstdc++-v3/include/bits/stl_stack.h
+++ b/libstdc++-v3/include/bits/stl_stack.h
@@ -213,7 +213,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#ifdef __GXX_EXPERIMENTAL_CXX0X__
void
- swap(stack&& __s)
+ swap(stack& __s)
{ c.swap(__s.c); }
#endif
};
@@ -282,16 +282,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
inline void
swap(stack<_Tp, _Seq>& __x, stack<_Tp, _Seq>& __y)
{ __x.swap(__y); }
-
- template<typename _Tp, typename _Seq>
- inline void
- swap(stack<_Tp, _Seq>&& __x, stack<_Tp, _Seq>& __y)
- { __x.swap(__y); }
-
- template<typename _Tp, typename _Seq>
- inline void
- swap(stack<_Tp, _Seq>& __x, stack<_Tp, _Seq>&& __y)
- { __x.swap(__y); }
#endif
_GLIBCXX_END_NAMESPACE
diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h
index ecf3b5c..1a67b56 100644
--- a/libstdc++-v3/include/bits/stl_tree.h
+++ b/libstdc++-v3/include/bits/stl_tree.h
@@ -675,11 +675,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return _M_get_Node_allocator().max_size(); }
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(_Rb_tree&& __t);
-#else
swap(_Rb_tree& __t);
-#endif
// Insert/erase.
pair<iterator, bool>
@@ -1104,11 +1100,7 @@ _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)
{
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index 9af983d..a68e956 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -923,11 +923,7 @@ _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);
@@ -1216,18 +1212,6 @@ _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 */
diff --git a/libstdc++-v3/include/bits/unique_ptr.h b/libstdc++-v3/include/bits/unique_ptr.h
index b686d11f..c1185f2 100644
--- a/libstdc++-v3/include/bits/unique_ptr.h
+++ b/libstdc++-v3/include/bits/unique_ptr.h
@@ -204,7 +204,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
}
void
- swap(unique_ptr&& __u)
+ swap(unique_ptr& __u)
{
using std::swap;
swap(_M_t, __u._M_t);
@@ -350,7 +350,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
void reset(_Up) = delete;
void
- swap(unique_ptr&& __u)
+ swap(unique_ptr& __u)
{
using std::swap;
swap(_M_t, __u._M_t);
@@ -389,18 +389,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
unique_ptr<_Tp, _Tp_Deleter>& __y)
{ __x.swap(__y); }
- template<typename _Tp, typename _Tp_Deleter>
- inline void
- swap(unique_ptr<_Tp, _Tp_Deleter>&& __x,
- unique_ptr<_Tp, _Tp_Deleter>& __y)
- { __x.swap(__y); }
-
- template<typename _Tp, typename _Tp_Deleter>
- inline void
- swap(unique_ptr<_Tp, _Tp_Deleter>& __x,
- unique_ptr<_Tp, _Tp_Deleter>&& __y)
- { __x.swap(__y); }
-
template<typename _Tp, typename _Tp_Deleter,
typename _Up, typename _Up_Deleter>
inline bool
diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque
index b481fd1..3a39dc4 100644
--- a/libstdc++-v3/include/debug/deque
+++ b/libstdc++-v3/include/debug/deque
@@ -432,11 +432,7 @@ namespace __debug
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(deque&& __x)
-#else
swap(deque& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
@@ -497,18 +493,6 @@ namespace __debug
swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>& __rhs)
{ __lhs.swap(__rhs); }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- template<typename _Tp, typename _Alloc>
- inline void
- swap(deque<_Tp, _Alloc>&& __lhs, deque<_Tp, _Alloc>& __rhs)
- { __lhs.swap(__rhs); }
-
- template<typename _Tp, typename _Alloc>
- 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 39f763a..d490489 100644
--- a/libstdc++-v3/include/debug/list
+++ b/libstdc++-v3/include/debug/list
@@ -367,11 +367,7 @@ namespace __debug
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(list&& __x)
-#else
swap(list& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
@@ -635,18 +631,6 @@ namespace __debug
swap(list<_Tp, _Alloc>& __lhs, list<_Tp, _Alloc>& __rhs)
{ __lhs.swap(__rhs); }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- template<typename _Tp, typename _Alloc>
- inline void
- swap(list<_Tp, _Alloc>&& __lhs, list<_Tp, _Alloc>& __rhs)
- { __lhs.swap(__rhs); }
-
- template<typename _Tp, typename _Alloc>
- 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 de1e5a5..c8eec2c 100644
--- a/libstdc++-v3/include/debug/map.h
+++ b/libstdc++-v3/include/debug/map.h
@@ -260,11 +260,7 @@ namespace __debug
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(map&& __x)
-#else
swap(map& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
@@ -390,22 +386,6 @@ namespace __debug
map<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ __lhs.swap(__rhs); }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- template<typename _Key, typename _Tp,
- typename _Compare, typename _Allocator>
- inline void
- swap(map<_Key, _Tp, _Compare, _Allocator>&& __lhs,
- map<_Key, _Tp, _Compare, _Allocator>& __rhs)
- { __lhs.swap(__rhs); }
-
- template<typename _Key, typename _Tp,
- typename _Compare, typename _Allocator>
- 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 42741da..16841ff 100644
--- a/libstdc++-v3/include/debug/multimap.h
+++ b/libstdc++-v3/include/debug/multimap.h
@@ -248,11 +248,7 @@ namespace __debug
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(multimap&& __x)
-#else
swap(multimap& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
@@ -378,22 +374,6 @@ namespace __debug
multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
{ __lhs.swap(__rhs); }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- template<typename _Key, typename _Tp,
- typename _Compare, typename _Allocator>
- inline void
- swap(multimap<_Key, _Tp, _Compare, _Allocator>&& __lhs,
- multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
- { __lhs.swap(__rhs); }
-
- template<typename _Key, typename _Tp,
- typename _Compare, typename _Allocator>
- 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 3e4ee86..a952663 100644
--- a/libstdc++-v3/include/debug/multiset.h
+++ b/libstdc++-v3/include/debug/multiset.h
@@ -245,11 +245,7 @@ namespace __debug
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(multiset&& __x)
-#else
swap(multiset& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
@@ -376,20 +372,6 @@ namespace __debug
multiset<_Key, _Compare, _Allocator>& __y)
{ return __x.swap(__y); }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- template<typename _Key, typename _Compare, typename _Allocator>
- void
- swap(multiset<_Key, _Compare, _Allocator>&& __x,
- multiset<_Key, _Compare, _Allocator>& __y)
- { return __x.swap(__y); }
-
- template<typename _Key, typename _Compare, typename _Allocator>
- 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 a025b3d..131b817 100644
--- a/libstdc++-v3/include/debug/set.h
+++ b/libstdc++-v3/include/debug/set.h
@@ -250,11 +250,7 @@ namespace __debug
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(set&& __x)
-#else
swap(set& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
@@ -381,20 +377,6 @@ namespace __debug
set<_Key, _Compare, _Allocator>& __y)
{ return __x.swap(__y); }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- template<typename _Key, typename _Compare, typename _Allocator>
- void
- swap(set<_Key, _Compare, _Allocator>&& __x,
- set<_Key, _Compare, _Allocator>& __y)
- { return __x.swap(__y); }
-
- template<typename _Key, typename _Compare, typename _Allocator>
- 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/unordered_map b/libstdc++-v3/include/debug/unordered_map
index fd7c31e..93a7206 100644
--- a/libstdc++-v3/include/debug/unordered_map
+++ b/libstdc++-v3/include/debug/unordered_map
@@ -129,7 +129,7 @@ namespace __debug
}
void
- swap(unordered_map&& __x)
+ swap(unordered_map& __x)
{
_Base::swap(__x);
_Safe_base::_M_swap(__x);
@@ -314,20 +314,6 @@ namespace __debug
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); }
- template<typename _Key, typename _Tp, typename _Hash,
- typename _Pred, typename _Alloc>
- inline void
- swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
- unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
- { __x.swap(__y); }
-
- template<typename _Key, typename _Tp, typename _Hash,
- typename _Pred, typename _Alloc>
- inline void
- swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
- unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
- { __x.swap(__y); }
-
template<typename _Key, typename _Tp,
typename _Hash = std::hash<_Key>,
@@ -415,7 +401,7 @@ namespace __debug
}
void
- swap(unordered_multimap&& __x)
+ swap(unordered_multimap& __x)
{
_Base::swap(__x);
_Safe_base::_M_swap(__x);
@@ -588,20 +574,6 @@ namespace __debug
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); }
- template<typename _Key, typename _Tp, typename _Hash,
- typename _Pred, typename _Alloc>
- inline void
- swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
- unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
- { __x.swap(__y); }
-
- template<typename _Key, typename _Tp, typename _Hash,
- typename _Pred, typename _Alloc>
- inline void
- swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
- unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
- { __x.swap(__y); }
-
} // namespace __debug
} // namespace std
diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set
index d340442..96d0b0f 100644
--- a/libstdc++-v3/include/debug/unordered_set
+++ b/libstdc++-v3/include/debug/unordered_set
@@ -129,7 +129,7 @@ namespace __debug
}
void
- swap(unordered_set&& __x)
+ swap(unordered_set& __x)
{
_Base::swap(__x);
_Safe_base::_M_swap(__x);
@@ -313,18 +313,6 @@ namespace __debug
unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); }
- template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
- inline void
- swap(unordered_set<_Value, _Hash, _Pred, _Alloc>&& __x,
- unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
- { __x.swap(__y); }
-
- template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
- inline void
- swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
- unordered_set<_Value, _Hash, _Pred, _Alloc>&& __y)
- { __x.swap(__y); }
-
template<typename _Value,
typename _Hash = std::hash<_Value>,
@@ -411,7 +399,7 @@ namespace __debug
}
void
- swap(unordered_multiset&& __x)
+ swap(unordered_multiset& __x)
{
_Base::swap(__x);
_Safe_base::_M_swap(__x);
@@ -583,18 +571,6 @@ namespace __debug
unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); }
- template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
- inline void
- swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __x,
- unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
- { __x.swap(__y); }
-
- template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
- inline void
- swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
- unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __y)
- { __x.swap(__y); }
-
} // namespace __debug
} // namespace std
diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector
index 97ab7bf..708ee45 100644
--- a/libstdc++-v3/include/debug/vector
+++ b/libstdc++-v3/include/debug/vector
@@ -452,11 +452,7 @@ namespace __debug
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(vector&& __x)
-#else
swap(vector& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
@@ -533,18 +529,6 @@ namespace __debug
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
diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h
index f15d6c6..cfce575 100644
--- a/libstdc++-v3/include/ext/vstring.h
+++ b/libstdc++-v3/include/ext/vstring.h
@@ -1439,11 +1439,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
* constant time.
*/
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(__versa_string&& __s)
-#else
swap(__versa_string& __s)
-#endif
{ this->_M_swap(__s); }
// String operations:
@@ -2335,22 +2331,6 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
{ __lhs.swap(__rhs); }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- template<typename _CharT, typename _Traits, typename _Alloc,
- template <typename, typename, typename> class _Base>
- inline void
- swap(__versa_string<_CharT, _Traits, _Alloc, _Base>&& __lhs,
- __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
- { __lhs.swap(__rhs); }
-
- template<typename _CharT, typename _Traits, typename _Alloc,
- template <typename, typename, typename> class _Base>
- inline void
- swap(__versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
- __versa_string<_CharT, _Traits, _Alloc, _Base>&& __rhs)
- { __lhs.swap(__rhs); }
-#endif
-
_GLIBCXX_END_NAMESPACE
_GLIBCXX_BEGIN_NAMESPACE(std)
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index f313ccb..75595a9 100644
--- a/libstdc++-v3/include/std/mutex
+++ b/libstdc++-v3/include/std/mutex
@@ -555,7 +555,7 @@ namespace std
}
void
- swap(unique_lock&& __u)
+ swap(unique_lock& __u)
{
std::swap(_M_device, __u._M_device);
std::swap(_M_owns, __u._M_owns);
@@ -591,16 +591,6 @@ namespace std
swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y)
{ __x.swap(__y); }
- template<typename _Mutex>
- inline void
- swap(unique_lock<_Mutex>&& __x, unique_lock<_Mutex>& __y)
- { __x.swap(__y); }
-
- template<typename _Mutex>
- inline void
- swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>&& __y)
- { __x.swap(__y); }
-
template<int _Idx>
struct __unlock_impl
{
diff --git a/libstdc++-v3/include/std/thread b/libstdc++-v3/include/std/thread
index 8ce9e5c..fbdfe2e 100644
--- a/libstdc++-v3/include/std/thread
+++ b/libstdc++-v3/include/std/thread
@@ -88,7 +88,7 @@ namespace std
template<class _CharT, class _Traits>
friend basic_ostream<_CharT, _Traits>&
- operator<<(basic_ostream<_CharT, _Traits>&& __out, thread::id __id);
+ operator<<(basic_ostream<_CharT, _Traits>& __out, thread::id __id);
};
// Simple base type that the templatized, derived class containing
@@ -149,7 +149,7 @@ namespace std
}
void
- swap(thread&& __t)
+ swap(thread& __t)
{ std::swap(_M_id, __t._M_id); }
bool
@@ -194,14 +194,6 @@ namespace std
swap(thread& __x, thread& __y)
{ __x.swap(__y); }
- inline void
- swap(thread&& __x, thread& __y)
- { __x.swap(__y); }
-
- inline void
- swap(thread& __x, thread&& __y)
- { __x.swap(__y); }
-
inline bool
operator!=(thread::id __x, thread::id __y)
{ return !(__x == __y); }
@@ -220,7 +212,7 @@ namespace std
template<class _CharT, class _Traits>
inline basic_ostream<_CharT, _Traits>&
- operator<<(basic_ostream<_CharT, _Traits>&& __out, thread::id __id)
+ operator<<(basic_ostream<_CharT, _Traits>& __out, thread::id __id)
{
if (__id == thread::id())
return __out << "thread::id of a non-executing thread";
diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple
index c5dbe6b..8dc8dcf 100644
--- a/libstdc++-v3/include/std/tuple
+++ b/libstdc++-v3/include/std/tuple
@@ -77,7 +77,7 @@ namespace std
_Head& _M_head() { return *this; }
const _Head& _M_head() const { return *this; }
- void _M_swap_impl(_Head&&) { /* no-op */ }
+ void _M_swap_impl(_Head&) { /* no-op */ }
};
template<std::size_t _Idx, typename _Head>
@@ -97,7 +97,7 @@ namespace std
const _Head& _M_head() const { return _M_head_impl; }
void
- _M_swap_impl(_Head&& __h)
+ _M_swap_impl(_Head& __h)
{
using std::swap;
swap(__h, _M_head_impl);
@@ -125,7 +125,7 @@ namespace std
struct _Tuple_impl<_Idx>
{
protected:
- void _M_swap_impl(_Tuple_impl&&) { /* no-op */ }
+ void _M_swap_impl(_Tuple_impl&) { /* no-op */ }
};
/**
@@ -214,7 +214,7 @@ namespace std
protected:
void
- _M_swap_impl(_Tuple_impl&& __in)
+ _M_swap_impl(_Tuple_impl& __in)
{
_Base::_M_swap_impl(__in._M_head());
_Inherited::_M_swap_impl(__in._M_tail());
@@ -292,7 +292,7 @@ namespace std
}
void
- swap(tuple&& __in)
+ swap(tuple& __in)
{ _Inherited::_M_swap_impl(__in); }
};
@@ -301,7 +301,7 @@ namespace std
class tuple<>
{
public:
- void swap(tuple&&) { /* no-op */ }
+ void swap(tuple&) { /* no-op */ }
};
/// tuple (2-element), with construction and assignment from a pair.
@@ -394,7 +394,7 @@ namespace std
}
void
- swap(tuple&& __in)
+ swap(tuple& __in)
{
using std::swap;
swap(this->_M_head(), __in._M_head());
@@ -665,16 +665,6 @@ namespace std
swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y)
{ __x.swap(__y); }
- template<typename... _Elements>
- inline void
- swap(tuple<_Elements...>&& __x, tuple<_Elements...>& __y)
- { __x.swap(__y); }
-
- template<typename... _Elements>
- inline void
- swap(tuple<_Elements...>& __x, tuple<_Elements...>&& __y)
- { __x.swap(__y); }
-
// A class (and instance) which can be used in 'tie' when an element
// of a tuple is not required
struct _Swallow_assign
diff --git a/libstdc++-v3/include/tr1_impl/hashtable b/libstdc++-v3/include/tr1_impl/hashtable
index 7c90983..bce550f 100644
--- a/libstdc++-v3/include/tr1_impl/hashtable
+++ b/libstdc++-v3/include/tr1_impl/hashtable
@@ -225,11 +225,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
~_Hashtable();
-#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
- void swap(_Hashtable&&);
-#else
void swap(_Hashtable&);
-#endif
// Basic container operations
iterator
@@ -732,11 +728,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
void
_Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
_H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
-#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
- swap(_Hashtable&& __x)
-#else
swap(_Hashtable& __x)
-#endif
{
// The only base class with member variables is hash_code_base. We
// define _Hash_code_base::_M_swap because different specializations
diff --git a/libstdc++-v3/include/tr1_impl/unordered_map b/libstdc++-v3/include/tr1_impl/unordered_map
index cef6490..edf4978 100644
--- a/libstdc++-v3/include/tr1_impl/unordered_map
+++ b/libstdc++-v3/include/tr1_impl/unordered_map
@@ -340,31 +340,5 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); }
-#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
- template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
- inline void
- swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
- unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
- { __x.swap(__y); }
-
- template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
- inline void
- swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
- unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
- { __x.swap(__y); }
-
- template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
- inline void
- swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
- unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
- { __x.swap(__y); }
-
- template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
- inline void
- swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
- unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
- { __x.swap(__y); }
-#endif
-
_GLIBCXX_END_NAMESPACE_TR1
}
diff --git a/libstdc++-v3/include/tr1_impl/unordered_set b/libstdc++-v3/include/tr1_impl/unordered_set
index fc2ce2b..d52b151 100644
--- a/libstdc++-v3/include/tr1_impl/unordered_set
+++ b/libstdc++-v3/include/tr1_impl/unordered_set
@@ -330,31 +330,5 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); }
-#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
- template<class _Value, class _Hash, class _Pred, class _Alloc>
- inline void
- swap(unordered_set<_Value, _Hash, _Pred, _Alloc>&& __x,
- unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
- { __x.swap(__y); }
-
- template<class _Value, class _Hash, class _Pred, class _Alloc>
- inline void
- swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
- unordered_set<_Value, _Hash, _Pred, _Alloc>&& __y)
- { __x.swap(__y); }
-
- template<class _Value, class _Hash, class _Pred, class _Alloc>
- inline void
- swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __x,
- unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
- { __x.swap(__y); }
-
- template<class _Value, class _Hash, class _Pred, class _Alloc>
- inline void
- swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
- unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __y)
- { __x.swap(__y); }
-#endif
-
_GLIBCXX_END_NAMESPACE_TR1
}
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/modifiers/swap_rvalue.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/modifiers/swap_rvalue.cc
deleted file mode 100644
index 0ace59b..0000000
--- a/libstdc++-v3/testsuite/20_util/shared_ptr/modifiers/swap_rvalue.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-// { dg-do compile }
-
-// Copyright (C) 2008, 2009 Free Software Foundation
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// 20.7.12.2 Template class shared_ptr [util.smartptr.shared]
-
-#include <memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-
-// 20.7.12.2.4 shared_ptr modifiers [util.smartptr.shared.mod]
-
-// swap
-int
-test01()
-{
- bool test __attribute__((unused)) = true;
-
- std::shared_ptr<A> p(new A);
- p.swap(std::shared_ptr<A>(new A));
-
- return 0;
-}
-
-int
-main()
-{
- test01();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
index 9ec59fe..f743994 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1498 }
+// { dg-error "no matching" "" { target *-*-* } 1494 }
// { dg-excess-errors "" }
#include <deque>
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
index 3bccae4..b1136f5 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1437 }
+// { dg-error "no matching" "" { target *-*-* } 1433 }
// { dg-excess-errors "" }
#include <deque>
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
index 3c401f1..8752a7e 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1437 }
+// { dg-error "no matching" "" { target *-*-* } 1433 }
// { dg-excess-errors "" }
#include <deque>
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
index 2e812d0..8cf322e 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1582 }
+// { dg-error "no matching" "" { target *-*-* } 1578 }
// { dg-excess-errors "" }
#include <deque>
diff --git a/libstdc++-v3/testsuite/23_containers/headers/forward_list/synopsis.cc b/libstdc++-v3/testsuite/23_containers/headers/forward_list/synopsis.cc
index 759cea8..21d80cb 100644
--- a/libstdc++-v3/testsuite/23_containers/headers/forward_list/synopsis.cc
+++ b/libstdc++-v3/testsuite/23_containers/headers/forward_list/synopsis.cc
@@ -43,10 +43,4 @@ namespace std {
template <class T, class Allocator>
void swap(forward_list<T,Allocator>& x, forward_list<T,Allocator>& y);
-
- template <class T, class Allocator>
- void swap(forward_list<T,Allocator>&& x, forward_list<T,Allocator>& y);
-
- template <class T, class Allocator>
- void swap(forward_list<T,Allocator>& x, forward_list<T,Allocator>&& y);
}
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
index a32840f..e3c86f4 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1383 }
+// { dg-error "no matching" "" { target *-*-* } 1379 }
// { dg-excess-errors "" }
#include <list>
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
index f8ab970..ef26801 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1352 }
+// { dg-error "no matching" "" { target *-*-* } 1348 }
// { dg-excess-errors "" }
#include <list>
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
index 56460a2..4128015 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1352 }
+// { dg-error "no matching" "" { target *-*-* } 1348 }
// { dg-excess-errors "" }
#include <list>
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
index 9c4aba6..f16fcfb 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1352 }
+// { dg-error "no matching" "" { target *-*-* } 1348 }
// { dg-excess-errors "" }
#include <list>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
index 9cf809b..5bff1fe 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1051 }
+// { dg-error "no matching" "" { target *-*-* } 1047 }
// { dg-excess-errors "" }
#include <vector>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
index 42b5385..a50f522 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 991 }
+// { dg-error "no matching" "" { target *-*-* } 987 }
// { dg-excess-errors "" }
#include <vector>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
index 5d2b155..a871cec 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 991 }
+// { dg-error "no matching" "" { target *-*-* } 987 }
// { dg-excess-errors "" }
#include <vector>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
index 89b020b..d079335 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1092 }
+// { dg-error "no matching" "" { target *-*-* } 1088 }
// { dg-excess-errors "" }
#include <vector>
diff --git a/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc b/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc
index a30bf51..2a820ad 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc
@@ -30,21 +30,48 @@
void f() { }
-int main()
+void test01()
{
bool test __attribute__((unused)) = true;
- try
+ try
{
std::thread t1(f);
std::thread::id t1_id = t1.get_id();
std::thread t2;
- t2.swap(std::move(t1));
+ t2.swap(t1);
VERIFY( t1.get_id() == std::thread::id() );
VERIFY( t2.get_id() == t1_id );
+
+ t2.join();
+ }
+ catch (const std::system_error&)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+
+ try
+ {
+ std::thread t1(f);
+ std::thread::id t1_id = t1.get_id();
+
+ std::thread t2;
+ std::swap(t1, t2);
+ VERIFY( t1.get_id() == std::thread::id() );
+ VERIFY( t2.get_id() == t1_id );
+
t2.join();
}
catch (const std::system_error&)
@@ -55,6 +82,12 @@ int main()
{
VERIFY( false );
}
+}
+
+int main()
+{
+ test01();
+ test02();
return 0;
}
diff --git a/libstdc++-v3/testsuite/30_threads/thread/swap/2.cc b/libstdc++-v3/testsuite/30_threads/thread/swap/2.cc
deleted file mode 100644
index 62e6651..0000000
--- a/libstdc++-v3/testsuite/30_threads/thread/swap/2.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
-// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
-// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
-// { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-
-#include <thread>
-#include <system_error>
-#include <bits/move.h> // std::move
-#include <testsuite_hooks.h>
-
-void f() { }
-
-void test01()
-{
- try
- {
- std::thread t1(f);
- std::thread::id t1_id = t1.get_id();
-
- std::thread t2;
- std::swap(t1, t2);
-
- VERIFY( t1.get_id() == std::thread::id() );
- VERIFY( t2.get_id() == t1_id );
-
- t2.join();
- }
- catch (const std::system_error&)
- {
- VERIFY( false );
- }
- catch (...)
- {
- VERIFY( false );
- }
-}
-
-void test02()
-{
- try
- {
- std::thread t1(f);
- std::thread::id t1_id = t1.get_id();
-
- std::thread t2;
- std::swap(std::move(t1), t2);
-
- VERIFY( t2.get_id() == t1_id );
-
- t2.join();
- }
- catch (const std::system_error&)
- {
- VERIFY( false );
- }
- catch (...)
- {
- VERIFY( false );
- }
-}
-
-void test03()
-{
- try
- {
- std::thread t1(f);
- std::thread::id t1_id = t1.get_id();
-
- std::thread t2;
- std::swap(t2, std::move(t1));
-
- VERIFY( t2.get_id() == t1_id );
-
- t2.join();
- }
- catch (const std::system_error&)
- {
- VERIFY( false );
- }
- catch (...)
- {
- VERIFY( false );
- }
-}
-
-int main()
-{
- test01();
- test02();
- test03();
- return 0;
-}