mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +00:00
fix next, prev implementation and adapt-interface
This commit is contained in:
parent
69910ca06c
commit
a4c7df65e0
19 changed files with 679 additions and 639 deletions
|
@ -165,17 +165,26 @@ namespace sprout {
|
|||
}
|
||||
|
||||
//
|
||||
// next
|
||||
// distance
|
||||
//
|
||||
template<typename T>
|
||||
inline SPROUT_CONSTEXPR sprout::value_iterator<T> next(
|
||||
inline SPROUT_CONSTEXPR typename std::iterator_traits<sprout::value_iterator<T> >::difference_type
|
||||
distance(sprout::value_iterator<T> first, sprout::value_iterator<T> last) {
|
||||
return last - first;
|
||||
}
|
||||
|
||||
//
|
||||
// iterator_next
|
||||
//
|
||||
template<typename T>
|
||||
inline SPROUT_CONSTEXPR sprout::value_iterator<T> iterator_next(
|
||||
sprout::value_iterator<T> const& it
|
||||
)
|
||||
{
|
||||
return it.next();
|
||||
}
|
||||
template<typename T>
|
||||
inline SPROUT_CONSTEXPR sprout::value_iterator<T> next(
|
||||
inline SPROUT_CONSTEXPR sprout::value_iterator<T> iterator_next(
|
||||
sprout::value_iterator<T> const& it,
|
||||
typename sprout::value_iterator<T>::difference_type n
|
||||
)
|
||||
|
@ -184,32 +193,23 @@ namespace sprout {
|
|||
}
|
||||
|
||||
//
|
||||
// prev
|
||||
// iterator_prev
|
||||
//
|
||||
template<typename T>
|
||||
inline SPROUT_CONSTEXPR sprout::value_iterator<T> prev(
|
||||
inline SPROUT_CONSTEXPR sprout::value_iterator<T> iterator_prev(
|
||||
sprout::value_iterator<T> const& it
|
||||
)
|
||||
{
|
||||
return it.prev();
|
||||
}
|
||||
template<typename T>
|
||||
inline SPROUT_CONSTEXPR sprout::value_iterator<T> prev(
|
||||
inline SPROUT_CONSTEXPR sprout::value_iterator<T> iterator_prev(
|
||||
sprout::value_iterator<T> const& it,
|
||||
typename sprout::value_iterator<T>::difference_type n
|
||||
)
|
||||
{
|
||||
return it - n;
|
||||
}
|
||||
|
||||
//
|
||||
// distance
|
||||
//
|
||||
template<typename T>
|
||||
inline SPROUT_CONSTEXPR typename std::iterator_traits<sprout::value_iterator<T> >::difference_type
|
||||
distance(sprout::value_iterator<T> first, sprout::value_iterator<T> last) {
|
||||
return last - first;
|
||||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_ITERATOR_VALUE_ITERATOR_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue