aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std
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/include/std
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/include/std')
-rw-r--r--libstdc++-v3/include/std/mutex12
-rw-r--r--libstdc++-v3/include/std/thread14
-rw-r--r--libstdc++-v3/include/std/tuple24
3 files changed, 11 insertions, 39 deletions
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