stl_algobase.h (struct __iter_base): Rename to _Iter_base; add iterator_type typedef.
2010-02-05 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/stl_algobase.h (struct __iter_base): Rename to _Iter_base; add iterator_type typedef. (struct __miter_base): Rename to _Miter_base. (struct __niter_base): Rename to _Niter_base. (__miter_base, __niter_base): Add, use the latter; adjust everywhere. From-SVN: r156515
This commit is contained in:
parent
3cdabe3b06
commit
6989b63f39
@ -1,3 +1,11 @@
|
||||
2010-02-05 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/bits/stl_algobase.h (struct __iter_base): Rename to
|
||||
_Iter_base; add iterator_type typedef.
|
||||
(struct __miter_base): Rename to _Miter_base.
|
||||
(struct __niter_base): Rename to _Niter_base.
|
||||
(__miter_base, __niter_base): Add, use the latter; adjust everywhere.
|
||||
|
||||
2010-02-04 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
PR libstdc++/42460
|
||||
|
@ -262,34 +262,46 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
// If _Iterator has a base returns it otherwise _Iterator is returned
|
||||
// untouched
|
||||
template<typename _Iterator, bool _HasBase>
|
||||
struct __iter_base
|
||||
struct _Iter_base
|
||||
{
|
||||
static _Iterator
|
||||
__b(_Iterator __it)
|
||||
typedef _Iterator iterator_type;
|
||||
static iterator_type
|
||||
_S_base(_Iterator __it)
|
||||
{ return __it; }
|
||||
};
|
||||
|
||||
template<typename _Iterator>
|
||||
struct __iter_base<_Iterator, true>
|
||||
struct _Iter_base<_Iterator, true>
|
||||
{
|
||||
static typename _Iterator::iterator_type
|
||||
__b(_Iterator __it)
|
||||
typedef typename _Iterator::iterator_type iterator_type;
|
||||
static iterator_type
|
||||
_S_base(_Iterator __it)
|
||||
{ return __it.base(); }
|
||||
};
|
||||
|
||||
// If _Iterator is a __normal_iterator return its base (a plain pointer,
|
||||
// normally) otherwise return it untouched. See copy, fill, ...
|
||||
template<typename _Iterator>
|
||||
struct __niter_base
|
||||
: __iter_base<_Iterator, __is_normal_iterator<_Iterator>::__value>
|
||||
struct _Niter_base
|
||||
: _Iter_base<_Iterator, __is_normal_iterator<_Iterator>::__value>
|
||||
{ };
|
||||
|
||||
template<typename _Iterator>
|
||||
inline typename _Niter_base<_Iterator>::iterator_type
|
||||
__niter_base(_Iterator __it)
|
||||
{ return std::_Niter_base<_Iterator>::_S_base(__it); }
|
||||
|
||||
// Likewise, for move_iterator.
|
||||
template<typename _Iterator>
|
||||
struct __miter_base
|
||||
: __iter_base<_Iterator, __is_move_iterator<_Iterator>::__value>
|
||||
struct _Miter_base
|
||||
: _Iter_base<_Iterator, __is_move_iterator<_Iterator>::__value>
|
||||
{ };
|
||||
|
||||
template<typename _Iterator>
|
||||
inline typename _Miter_base<_Iterator>::iterator_type
|
||||
__miter_base(_Iterator __it)
|
||||
{ return std::_Miter_base<_Iterator>::_S_base(__it); }
|
||||
|
||||
// All of these auxiliary structs serve two purposes. (1) Replace
|
||||
// calls to copy with memmove whenever possible. (Memmove, not memcpy,
|
||||
// because the input and output ranges are permitted to overlap.)
|
||||
@ -425,10 +437,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
inline _OI
|
||||
__copy_move_a2(_II __first, _II __last, _OI __result)
|
||||
{
|
||||
return _OI(std::__copy_move_a<_IsMove>
|
||||
(std::__niter_base<_II>::__b(__first),
|
||||
std::__niter_base<_II>::__b(__last),
|
||||
std::__niter_base<_OI>::__b(__result)));
|
||||
return _OI(std::__copy_move_a<_IsMove>(std::__niter_base(__first),
|
||||
std::__niter_base(__last),
|
||||
std::__niter_base(__result)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -459,8 +470,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
__glibcxx_requires_valid_range(__first, __last);
|
||||
|
||||
return (std::__copy_move_a2<__is_move_iterator<_II>::__value>
|
||||
(std::__miter_base<_II>::__b(__first),
|
||||
std::__miter_base<_II>::__b(__last), __result));
|
||||
(std::__miter_base(__first), std::__miter_base(__last),
|
||||
__result));
|
||||
}
|
||||
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
@ -491,9 +502,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
typename iterator_traits<_II>::value_type>)
|
||||
__glibcxx_requires_valid_range(__first, __last);
|
||||
|
||||
return (std::__copy_move_a2<true>
|
||||
(std::__miter_base<_II>::__b(__first),
|
||||
std::__miter_base<_II>::__b(__last), __result));
|
||||
return std::__copy_move_a2<true>(std::__miter_base(__first),
|
||||
std::__miter_base(__last), __result);
|
||||
}
|
||||
|
||||
#define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::move(_Tp, _Up, _Vp)
|
||||
@ -596,9 +606,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
__copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)
|
||||
{
|
||||
return _BI2(std::__copy_move_backward_a<_IsMove>
|
||||
(std::__niter_base<_BI1>::__b(__first),
|
||||
std::__niter_base<_BI1>::__b(__last),
|
||||
std::__niter_base<_BI2>::__b(__result)));
|
||||
(std::__niter_base(__first), std::__niter_base(__last),
|
||||
std::__niter_base(__result)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -632,8 +641,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
__glibcxx_requires_valid_range(__first, __last);
|
||||
|
||||
return (std::__copy_move_backward_a2<__is_move_iterator<_BI1>::__value>
|
||||
(std::__miter_base<_BI1>::__b(__first),
|
||||
std::__miter_base<_BI1>::__b(__last), __result));
|
||||
(std::__miter_base(__first), std::__miter_base(__last),
|
||||
__result));
|
||||
}
|
||||
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
@ -667,9 +676,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
typename iterator_traits<_BI2>::value_type>)
|
||||
__glibcxx_requires_valid_range(__first, __last);
|
||||
|
||||
return (std::__copy_move_backward_a2<true>
|
||||
(std::__miter_base<_BI1>::__b(__first),
|
||||
std::__miter_base<_BI1>::__b(__last), __result));
|
||||
return std::__copy_move_backward_a2<true>(std::__miter_base(__first),
|
||||
std::__miter_base(__last),
|
||||
__result);
|
||||
}
|
||||
|
||||
#define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::move_backward(_Tp, _Up, _Vp)
|
||||
@ -730,8 +739,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
_ForwardIterator>)
|
||||
__glibcxx_requires_valid_range(__first, __last);
|
||||
|
||||
std::__fill_a(std::__niter_base<_ForwardIterator>::__b(__first),
|
||||
std::__niter_base<_ForwardIterator>::__b(__last), __value);
|
||||
std::__fill_a(std::__niter_base(__first), std::__niter_base(__last),
|
||||
__value);
|
||||
}
|
||||
|
||||
template<typename _OutputIterator, typename _Size, typename _Tp>
|
||||
@ -786,8 +795,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
// concept requirements
|
||||
__glibcxx_function_requires(_OutputIteratorConcept<_OI, _Tp>)
|
||||
|
||||
return _OI(std::__fill_n_a(std::__niter_base<_OI>::__b(__first),
|
||||
__n, __value));
|
||||
return _OI(std::__fill_n_a(std::__niter_base(__first), __n, __value));
|
||||
}
|
||||
|
||||
template<bool _BoolType>
|
||||
@ -958,9 +966,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
|
||||
typename iterator_traits<_II2>::value_type>)
|
||||
__glibcxx_requires_valid_range(__first1, __last1);
|
||||
|
||||
return std::__equal_aux(std::__niter_base<_II1>::__b(__first1),
|
||||
std::__niter_base<_II1>::__b(__last1),
|
||||
std::__niter_base<_II2>::__b(__first2));
|
||||
return std::__equal_aux(std::__niter_base(__first1),
|
||||
std::__niter_base(__last1),
|
||||
std::__niter_base(__first2));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1024,11 +1032,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
|
||||
__glibcxx_requires_valid_range(__first1, __last1);
|
||||
__glibcxx_requires_valid_range(__first2, __last2);
|
||||
|
||||
return std::__lexicographical_compare_aux
|
||||
(std::__niter_base<_II1>::__b(__first1),
|
||||
std::__niter_base<_II1>::__b(__last1),
|
||||
std::__niter_base<_II2>::__b(__first2),
|
||||
std::__niter_base<_II2>::__b(__last2));
|
||||
return std::__lexicographical_compare_aux(std::__niter_base(__first1),
|
||||
std::__niter_base(__last1),
|
||||
std::__niter_base(__first2),
|
||||
std::__niter_base(__last2));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user