fix next, prev implementation and adapt-interface

This commit is contained in:
bolero-MURAKAMI 2012-09-26 16:31:11 +09:00
parent 69910ca06c
commit a4c7df65e0
19 changed files with 679 additions and 639 deletions

View file

@ -199,44 +199,6 @@ namespace sprout {
lhs.swap(rhs);
}
//
// next
//
template<typename Iterator>
inline SPROUT_CONSTEXPR sprout::reverse_iterator<Iterator> next(
sprout::reverse_iterator<Iterator> const& it
)
{
return it.next();
}
template<typename Iterator>
inline SPROUT_CONSTEXPR sprout::reverse_iterator<Iterator> next(
sprout::reverse_iterator<Iterator> const& it,
typename sprout::reverse_iterator<Iterator>::difference_type n
)
{
return it + n;
}
//
// prev
//
template<typename Iterator>
inline SPROUT_CONSTEXPR sprout::reverse_iterator<Iterator> prev(
sprout::reverse_iterator<Iterator> const& it
)
{
return it.prev();
}
template<typename Iterator>
inline SPROUT_CONSTEXPR sprout::reverse_iterator<Iterator> prev(
sprout::reverse_iterator<Iterator> const& it,
typename sprout::reverse_iterator<Iterator>::difference_type n
)
{
return it - n;
}
//
// distance
//
@ -249,6 +211,44 @@ namespace sprout {
{
return last - first;
}
//
// iterator_next
//
template<typename Iterator>
inline SPROUT_CONSTEXPR sprout::reverse_iterator<Iterator> iterator_next(
sprout::reverse_iterator<Iterator> const& it
)
{
return it.next();
}
template<typename Iterator>
inline SPROUT_CONSTEXPR sprout::reverse_iterator<Iterator> iterator_next(
sprout::reverse_iterator<Iterator> const& it,
typename sprout::reverse_iterator<Iterator>::difference_type n
)
{
return it + n;
}
//
// iterator_prev
//
template<typename Iterator>
inline SPROUT_CONSTEXPR sprout::reverse_iterator<Iterator> iterator_prev(
sprout::reverse_iterator<Iterator> const& it
)
{
return it.prev();
}
template<typename Iterator>
inline SPROUT_CONSTEXPR sprout::reverse_iterator<Iterator> iterator_prev(
sprout::reverse_iterator<Iterator> const& it,
typename sprout::reverse_iterator<Iterator>::difference_type n
)
{
return it - n;
}
} // namespace sprout
#endif // #ifndef SPROUT_ITERATOR_REVERSE_ITERATOR_HPP