-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.
* function.
*/
void
- swap(forward_list&& __list)
+ swap(forward_list& __list)
{ _Node_base::swap(this->_M_impl._M_head, __list._M_impl._M_head); }
/**
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__
}
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);
* 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);
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 */
* 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);
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 */
* 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); }
/**
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 */
* 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); }
/**
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 */
* 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
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 */
}
void
- swap(pair&& __p)
+ swap(pair& __p)
{
using std::swap;
swap(first, __p.first);
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
/**
#ifdef __GXX_EXPERIMENTAL_CXX0X__
void
- swap(queue&& __q)
+ swap(queue& __q)
{ c.swap(__q.c); }
#endif
};
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
/**
#ifdef __GXX_EXPERIMENTAL_CXX0X__
void
- swap(priority_queue&& __pq)
+ swap(priority_queue& __pq)
{
using std::swap;
c.swap(__pq.c);
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
* 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
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 */
#ifdef __GXX_EXPERIMENTAL_CXX0X__
void
- swap(stack&& __s)
+ swap(stack& __s)
{ c.swap(__s.c); }
#endif
};
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
{ 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>
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)
{
* 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);
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 */
}
void
- swap(unique_ptr&& __u)
+ swap(unique_ptr& __u)
{
using std::swap;
swap(_M_t, __u._M_t);
void reset(_Up) = delete;
void
- swap(unique_ptr&& __u)
+ swap(unique_ptr& __u)
{
using std::swap;
swap(_M_t, __u._M_t);
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
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(deque&& __x)
-#else
swap(deque& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
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
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(list&& __x)
-#else
swap(list& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
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
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(map&& __x)
-#else
swap(map& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
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
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(multimap&& __x)
-#else
swap(multimap& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
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
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(multiset&& __x)
-#else
swap(multiset& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
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
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(set&& __x)
-#else
swap(set& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
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
}
void
- swap(unordered_map&& __x)
+ swap(unordered_map& __x)
{
_Base::swap(__x);
_Safe_base::_M_swap(__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,
- 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>,
}
void
- swap(unordered_multimap&& __x)
+ swap(unordered_multimap& __x)
{
_Base::swap(__x);
_Safe_base::_M_swap(__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); }
-
- 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
}
void
- swap(unordered_set&& __x)
+ swap(unordered_set& __x)
{
_Base::swap(__x);
_Safe_base::_M_swap(__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, 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>,
}
void
- swap(unordered_multiset&& __x)
+ swap(unordered_multiset& __x)
{
_Base::swap(__x);
_Safe_base::_M_swap(__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); }
-
- 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
}
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(vector&& __x)
-#else
swap(vector& __x)
-#endif
{
_Base::swap(__x);
this->_M_swap(__x);
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
* constant time.
*/
void
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- swap(__versa_string&& __s)
-#else
swap(__versa_string& __s)
-#endif
{ this->_M_swap(__s); }
// String operations:
__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)
}
void
- swap(unique_lock&& __u)
+ swap(unique_lock& __u)
{
std::swap(_M_device, __u._M_device);
std::swap(_M_owns, __u._M_owns);
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
{
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
}
void
- swap(thread&& __t)
+ swap(thread& __t)
{ std::swap(_M_id, __t._M_id); }
bool
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); }
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";
_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>
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);
struct _Tuple_impl<_Idx>
{
protected:
- void _M_swap_impl(_Tuple_impl&&) { /* no-op */ }
+ void _M_swap_impl(_Tuple_impl&) { /* no-op */ }
};
/**
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());
}
void
- swap(tuple&& __in)
+ swap(tuple& __in)
{ _Inherited::_M_swap_impl(__in); }
};
class tuple<>
{
public:
- void swap(tuple&&) { /* no-op */ }
+ void swap(tuple&) { /* no-op */ }
};
/// tuple (2-element), with construction and assignment from a pair.
}
void
- swap(tuple&& __in)
+ swap(tuple& __in)
{
using std::swap;
swap(this->_M_head(), __in._M_head());
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
~_Hashtable();
-#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
- void swap(_Hashtable&&);
-#else
void swap(_Hashtable&);
-#endif
// Basic container operations
iterator
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
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
}
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
}
+++ /dev/null
-// { 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;
-}
// <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>
// <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>
// <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>
// <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>
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);
}
// <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>
// <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>
// <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>
// <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>
// <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>
// <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>
// <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>
// <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>
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&)
{
VERIFY( false );
}
+}
+
+int main()
+{
+ test01();
+ test02();
return 0;
}
+++ /dev/null
-// { 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;
-}