diff options
author | Jason Merrill <jason@redhat.com> | 2009-07-31 22:26:32 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-07-31 22:26:32 -0400 |
commit | 4c65085391c06df2a7b1acb4767e63aee6763d2c (patch) | |
tree | 0622cddd7ff39f432afe2772f57eb2d805fea001 /libstdc++-v3/include | |
parent | 9771799c29d553ad28453dd5bf2e72d6be593531 (diff) | |
download | gcc-4c65085391c06df2a7b1acb4767e63aee6763d2c.zip gcc-4c65085391c06df2a7b1acb4767e63aee6763d2c.tar.gz gcc-4c65085391c06df2a7b1acb4767e63aee6763d2c.tar.bz2 |
forward_list.h (splice_after): Use forward.
* include/bits/forward_list.h (splice_after): Use forward.
(merge): Likewise.
* include/bits/stl_iterator.h (move_iterator::operator*): Use move.
(move_iterator::operator[]): Use move.
* include/bits/stl_list.h (insert): Use move.
* include/std/thread (_Callable constructor): Use forward.
* include/std/tuple: Don't specify explicit template args to move.
From-SVN: r150326
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/bits/forward_list.h | 7 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_iterator.h | 4 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_list.h | 10 | ||||
-rw-r--r-- | libstdc++-v3/include/std/thread | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/std/tuple | 13 |
5 files changed, 26 insertions, 13 deletions
diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h index 724d87b..5158f2d 100644 --- a/libstdc++-v3/include/bits/forward_list.h +++ b/libstdc++-v3/include/bits/forward_list.h @@ -1057,7 +1057,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std) void splice_after(const_iterator __pos, forward_list&& __list, const_iterator __it) - { this->splice_after(__pos, __list, __it, __it._M_next()); } + { + this->splice_after(__pos, std::forward<forward_list>(__list), + __it, __it._M_next()); + } /** * @brief Insert range from another %forward_list. @@ -1146,7 +1149,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) */ void merge(forward_list&& __list) - { this->merge(__list, std::less<_Tp>()); } + { this->merge(std::forward<forward_list>(__list), std::less<_Tp>()); } /** * @brief Merge sorted lists according to comparison function. diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h index 129552f..eb72900 100644 --- a/libstdc++-v3/include/bits/stl_iterator.h +++ b/libstdc++-v3/include/bits/stl_iterator.h @@ -913,7 +913,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) reference operator*() const - { return *_M_current; } + { return std::move(*_M_current); } pointer operator->() const @@ -973,7 +973,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) reference operator[](difference_type __n) const - { return _M_current[__n]; } + { return std::move(_M_current[__n]); } }; template<typename _IteratorL, typename _IteratorR> diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h index f758bae..2a6e58f 100644 --- a/libstdc++-v3/include/bits/stl_list.h +++ b/libstdc++-v3/include/bits/stl_list.h @@ -1027,7 +1027,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) insert(iterator __position, size_type __n, const value_type& __x) { list __tmp(__n, __x, _M_get_Node_allocator()); - splice(__position, __tmp); +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + splice(__position, std::move(__tmp)); +#else + splice(__position, __tmp); +#endif } /** @@ -1049,7 +1053,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) _InputIterator __last) { list __tmp(__first, __last, _M_get_Node_allocator()); +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + splice(__position, std::move(__tmp)); +#else splice(__position, __tmp); +#endif } /** diff --git a/libstdc++-v3/include/std/thread b/libstdc++-v3/include/std/thread index bf282cc..83b259d 100644 --- a/libstdc++-v3/include/std/thread +++ b/libstdc++-v3/include/std/thread @@ -126,7 +126,10 @@ namespace std template<typename _Callable> explicit thread(_Callable __f) - { _M_start_thread(_M_make_routine<_Callable>(__f)); } + { + _M_start_thread(_M_make_routine<_Callable> + (std::forward<_Callable>(__f))); + } template<typename _Callable, typename... _Args> thread(_Callable&& __f, _Args&&... __args) diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 8dc8dcf..18cd89b 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -164,7 +164,7 @@ namespace std : _Inherited(__in._M_tail()), _Base(__in._M_head()) { } _Tuple_impl(_Tuple_impl&& __in) - : _Inherited(std::move<_Inherited&&>(__in._M_tail())), + : _Inherited(std::move(__in._M_tail())), _Base(std::forward<_Head>(__in._M_head())) { } template<typename... _UElements> @@ -173,8 +173,7 @@ namespace std template<typename... _UElements> _Tuple_impl(_Tuple_impl<_Idx, _UElements...>&& __in) - : _Inherited(std::move<typename _Tuple_impl<_Idx, _UElements...>:: - _Inherited&&>(__in._M_tail())), + : _Inherited(std::move(__in._M_tail())), _Base(std::forward<typename _Tuple_impl<_Idx, _UElements...>:: _Base>(__in._M_head())) { } @@ -244,7 +243,7 @@ namespace std : _Inherited(static_cast<const _Inherited&>(__in)) { } tuple(tuple&& __in) - : _Inherited(std::move<_Inherited>(__in)) { } + : _Inherited(static_cast<_Inherited&&>(__in)) { } template<typename... _UElements> tuple(const tuple<_UElements...>& __in) @@ -253,7 +252,7 @@ namespace std template<typename... _UElements> tuple(tuple<_UElements...>&& __in) - : _Inherited(std::move<_Tuple_impl<0, _UElements...> >(__in)) { } + : _Inherited(static_cast<_Tuple_impl<0, _UElements...>&&>(__in)) { } // XXX http://gcc.gnu.org/ml/libstdc++/2008-02/msg00047.html template<typename... _UElements> @@ -327,7 +326,7 @@ namespace std : _Inherited(static_cast<const _Inherited&>(__in)) { } tuple(tuple&& __in) - : _Inherited(std::move<_Inherited>(__in)) { } + : _Inherited(static_cast<_Inherited&&>(__in)) { } template<typename _U1, typename _U2> tuple(const tuple<_U1, _U2>& __in) @@ -335,7 +334,7 @@ namespace std template<typename _U1, typename _U2> tuple(tuple<_U1, _U2>&& __in) - : _Inherited(std::move<_Tuple_impl<0, _U1, _U2> >(__in)) { } + : _Inherited(static_cast<_Tuple_impl<0, _U1, _U2>&&>(__in)) { } template<typename _U1, typename _U2> tuple(const pair<_U1, _U2>& __in) |