mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-18 15:24:11 +00:00
fix recursion depth O(logN): some algorithms
This commit is contained in:
parent
28697ee7a8
commit
5019f6aa96
162 changed files with 3600 additions and 1659 deletions
|
@ -184,15 +184,6 @@ namespace sprout {
|
|||
lhs.swap(rhs);
|
||||
}
|
||||
|
||||
//
|
||||
// iterator_distance
|
||||
//
|
||||
template<typename Incrementable>
|
||||
inline SPROUT_CONSTEXPR typename std::iterator_traits<sprout::counting_iterator<Incrementable> >::difference_type
|
||||
iterator_distance(sprout::counting_iterator<Incrementable> first, sprout::counting_iterator<Incrementable> last) {
|
||||
return last - first;
|
||||
}
|
||||
|
||||
//
|
||||
// iterator_next
|
||||
//
|
||||
|
@ -201,15 +192,6 @@ namespace sprout {
|
|||
iterator_next(sprout::counting_iterator<Incrementable> const& it) {
|
||||
return it.next();
|
||||
}
|
||||
template<typename Incrementable>
|
||||
inline SPROUT_CONSTEXPR sprout::counting_iterator<Incrementable>
|
||||
iterator_next(
|
||||
sprout::counting_iterator<Incrementable> const& it,
|
||||
typename sprout::counting_iterator<Incrementable>::difference_type n
|
||||
)
|
||||
{
|
||||
return it + n;
|
||||
}
|
||||
|
||||
//
|
||||
// iterator_prev
|
||||
|
@ -219,15 +201,6 @@ namespace sprout {
|
|||
iterator_prev(sprout::counting_iterator<Incrementable> const& it) {
|
||||
return it.prev();
|
||||
}
|
||||
template<typename Incrementable>
|
||||
inline SPROUT_CONSTEXPR sprout::counting_iterator<Incrementable>
|
||||
iterator_prev(
|
||||
sprout::counting_iterator<Incrementable> const& it,
|
||||
typename sprout::counting_iterator<Incrementable>::difference_type n
|
||||
)
|
||||
{
|
||||
return it - n;
|
||||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_ITERATOR_COUNTING_ITERATOR_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue