From: François Dumont Date: Wed, 20 May 2015 19:02:22 +0000 (+0000) Subject: 2015-05-20 François Dumont X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fd2ef1171407340dbb09935ab535debf40f56376;p=gcc.git 2015-05-20 François Dumont * include/bits/cpp_type_traits.h (std::move_iterator): Delete declaration. (std::__is_move_iterator): Move partial specialization... * include/bits/stl_iterator.h: ... here. (std::__miter_base): Overloads for std::reverse_iterator and std::move_iterator. * include/bits/stl_algobase.h (std::__miter_base): Provide default implementation. From-SVN: r223453 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ce5573c473b..773c1dd62f8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,14 @@ +2015-05-20 François Dumont + + * include/bits/cpp_type_traits.h + (std::move_iterator): Delete declaration. + (std::__is_move_iterator): Move partial specialization... + * include/bits/stl_iterator.h: ... here. + (std::__miter_base): Overloads for std::reverse_iterator and + std::move_iterator. + * include/bits/stl_algobase.h (std::__miter_base): Provide default + implementation. + 2015-05-20 Jonathan Wakely * testsuite/util/testsuite_fs.h (nonexistent_path): Don't use tempnam. diff --git a/libstdc++-v3/include/bits/cpp_type_traits.h b/libstdc++-v3/include/bits/cpp_type_traits.h index 21429175c05..f7b76bf8b51 100644 --- a/libstdc++-v3/include/bits/cpp_type_traits.h +++ b/libstdc++-v3/include/bits/cpp_type_traits.h @@ -399,18 +399,6 @@ __INT_N(__GLIBCXX_TYPE_INT_N_3) typedef __false_type __type; }; -#if __cplusplus >= 201103L - template - class move_iterator; - - template - struct __is_move_iterator< move_iterator<_Iterator> > - { - enum { __value = 1 }; - typedef __true_type __type; - }; -#endif - _GLIBCXX_END_NAMESPACE_VERSION } // namespace diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index 630b3a04fc2..409ef364da5 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -277,17 +277,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __niter_base(_Iterator __it) { return __it; } - // If _Iterator is a move_iterator return its base otherwise return it - // untouched. See copy, fill, ... + // Likewise for move_iterator. template - struct _Miter_base - : _Iter_base<_Iterator, __is_move_iterator<_Iterator>::__value> - { }; - - template - inline typename _Miter_base<_Iterator>::iterator_type + inline _Iterator __miter_base(_Iterator __it) - { return std::_Miter_base<_Iterator>::_S_base(__it); } + { return __it; } // All of these auxiliary structs serve two purposes. (1) Replace // calls to copy with memmove whenever possible. (Memmove, not memcpy, diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h index b8e79dfa7e4..58b9aabf2e6 100644 --- a/libstdc++-v3/include/bits/stl_iterator.h +++ b/libstdc++-v3/include/bits/stl_iterator.h @@ -414,6 +414,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __niter_base(reverse_iterator<_Iterator> __it) -> decltype(__make_reverse_iterator(__niter_base(__it.base()))) { return __make_reverse_iterator(__niter_base(__it.base())); } + + template + struct __is_move_iterator > + : __is_move_iterator<_Iterator> + { }; + + template + auto + __miter_base(reverse_iterator<_Iterator> __it) + -> decltype(__make_reverse_iterator(__miter_base(__it.base()))) + { return __make_reverse_iterator(__miter_base(__it.base())); } #endif // 24.4.2.2.1 back_insert_iterator @@ -1211,6 +1222,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION -> decltype(make_move_iterator(__niter_base(__it.base()))) { return make_move_iterator(__niter_base(__it.base())); } + template + struct __is_move_iterator > + { + enum { __value = 1 }; + typedef __true_type __type; + }; + + template + auto + __miter_base(move_iterator<_Iterator> __it) + -> decltype(__miter_base(__it.base())) + { return __miter_base(__it.base()); } + _GLIBCXX_END_NAMESPACE_VERSION } // namespace