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
|
@ -398,19 +398,6 @@ namespace sprout {
|
|||
lhs.swap(rhs);
|
||||
}
|
||||
|
||||
//
|
||||
// iterator_distance
|
||||
//
|
||||
template<typename UnaryOrBinaryFunction, typename LIterator, typename RIterator>
|
||||
inline SPROUT_CONSTEXPR typename std::iterator_traits<sprout::transform_iterator<UnaryOrBinaryFunction, LIterator, RIterator> >::difference_type
|
||||
iterator_distance(
|
||||
sprout::transform_iterator<UnaryOrBinaryFunction, LIterator, RIterator> first,
|
||||
sprout::transform_iterator<UnaryOrBinaryFunction, LIterator, RIterator> last
|
||||
)
|
||||
{
|
||||
return last - first;
|
||||
}
|
||||
|
||||
//
|
||||
// iterator_next
|
||||
//
|
||||
|
@ -419,15 +406,6 @@ namespace sprout {
|
|||
iterator_next(sprout::transform_iterator<UnaryOrBinaryFunction, LIterator, RIterator> const& it) {
|
||||
return it.next();
|
||||
}
|
||||
template<typename UnaryOrBinaryFunction, typename LIterator, typename RIterator>
|
||||
inline SPROUT_CONSTEXPR sprout::transform_iterator<UnaryOrBinaryFunction, LIterator, RIterator>
|
||||
iterator_next(
|
||||
sprout::transform_iterator<UnaryOrBinaryFunction, LIterator, RIterator> const& it,
|
||||
typename sprout::transform_iterator<UnaryOrBinaryFunction, LIterator, RIterator>::difference_type n
|
||||
)
|
||||
{
|
||||
return it + n;
|
||||
}
|
||||
|
||||
//
|
||||
// iterator_prev
|
||||
|
@ -437,15 +415,6 @@ namespace sprout {
|
|||
iterator_prev(sprout::transform_iterator<UnaryOrBinaryFunction, LIterator, RIterator> const& it) {
|
||||
return it.prev();
|
||||
}
|
||||
template<typename UnaryOrBinaryFunction, typename LIterator, typename RIterator>
|
||||
inline SPROUT_CONSTEXPR sprout::transform_iterator<UnaryOrBinaryFunction, LIterator, RIterator>
|
||||
iterator_prev(
|
||||
sprout::transform_iterator<UnaryOrBinaryFunction, LIterator, RIterator> const& it,
|
||||
typename sprout::transform_iterator<UnaryOrBinaryFunction, LIterator, RIterator>::difference_type n
|
||||
)
|
||||
{
|
||||
return it - n;
|
||||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_ITERATOR_TRANSFORM_ITERATOR_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue