2015-05-20 François Dumont <fdumont@gcc.gnu.org>
* include/bits/cpp_type_traits.h (std::move_iterator): Delete declaration. (std::__is_move_iterator<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
This commit is contained in:
parent
91767ed11a
commit
fd2ef11714
@ -1,3 +1,14 @@
|
||||
2015-05-20 François Dumont <fdumont@gcc.gnu.org>
|
||||
|
||||
* include/bits/cpp_type_traits.h
|
||||
(std::move_iterator): Delete declaration.
|
||||
(std::__is_move_iterator<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 <jwakely@redhat.com>
|
||||
|
||||
* testsuite/util/testsuite_fs.h (nonexistent_path): Don't use tempnam.
|
||||
|
@ -399,18 +399,6 @@ __INT_N(__GLIBCXX_TYPE_INT_N_3)
|
||||
typedef __false_type __type;
|
||||
};
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
template<typename _Iterator>
|
||||
class move_iterator;
|
||||
|
||||
template<typename _Iterator>
|
||||
struct __is_move_iterator< move_iterator<_Iterator> >
|
||||
{
|
||||
enum { __value = 1 };
|
||||
typedef __true_type __type;
|
||||
};
|
||||
#endif
|
||||
|
||||
_GLIBCXX_END_NAMESPACE_VERSION
|
||||
} // namespace
|
||||
|
||||
|
@ -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<typename _Iterator>
|
||||
struct _Miter_base
|
||||
: _Iter_base<_Iterator, __is_move_iterator<_Iterator>::__value>
|
||||
{ };
|
||||
|
||||
template<typename _Iterator>
|
||||
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,
|
||||
|
@ -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<typename _Iterator>
|
||||
struct __is_move_iterator<reverse_iterator<_Iterator> >
|
||||
: __is_move_iterator<_Iterator>
|
||||
{ };
|
||||
|
||||
template<typename _Iterator>
|
||||
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<typename _Iterator>
|
||||
struct __is_move_iterator<move_iterator<_Iterator> >
|
||||
{
|
||||
enum { __value = 1 };
|
||||
typedef __true_type __type;
|
||||
};
|
||||
|
||||
template<typename _Iterator>
|
||||
auto
|
||||
__miter_base(move_iterator<_Iterator> __it)
|
||||
-> decltype(__miter_base(__it.base()))
|
||||
{ return __miter_base(__it.base()); }
|
||||
|
||||
_GLIBCXX_END_NAMESPACE_VERSION
|
||||
} // namespace
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user