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

@ -195,44 +195,6 @@ namespace sprout {
: public std::true_type
{};
//
// next
//
template<typename Container>
inline SPROUT_CONSTEXPR sprout::index_iterator<Container> next(
sprout::index_iterator<Container> const& it
)
{
return it.next();
}
template<typename Container>
inline SPROUT_CONSTEXPR sprout::index_iterator<Container> next(
sprout::index_iterator<Container> const& it,
typename sprout::index_iterator<Container>::difference_type n
)
{
return it + n;
}
//
// prev
//
template<typename Container>
inline SPROUT_CONSTEXPR sprout::index_iterator<Container> prev(
sprout::index_iterator<Container> const& it
)
{
return it.prev();
}
template<typename Container>
inline SPROUT_CONSTEXPR sprout::index_iterator<Container> prev(
sprout::index_iterator<Container> const& it,
typename sprout::index_iterator<Container>::difference_type n
)
{
return it - n;
}
//
// distance
//
@ -245,6 +207,44 @@ namespace sprout {
{
return last - first;
}
//
// iterator_next
//
template<typename Container>
inline SPROUT_CONSTEXPR sprout::index_iterator<Container> iterator_next(
sprout::index_iterator<Container> const& it
)
{
return it.next();
}
template<typename Container>
inline SPROUT_CONSTEXPR sprout::index_iterator<Container> iterator_next(
sprout::index_iterator<Container> const& it,
typename sprout::index_iterator<Container>::difference_type n
)
{
return it + n;
}
//
// iterator_prev
//
template<typename Container>
inline SPROUT_CONSTEXPR sprout::index_iterator<Container> iterator_prev(
sprout::index_iterator<Container> const& it
)
{
return it.prev();
}
template<typename Container>
inline SPROUT_CONSTEXPR sprout::index_iterator<Container> iterator_prev(
sprout::index_iterator<Container> const& it,
typename sprout::index_iterator<Container>::difference_type n
)
{
return it - n;
}
} // namespace sprout
#endif // #ifndef SPROUT_ITERATOR_INDEX_ITERATOR_HPP