1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

fix adaptors alternated, taken, dropped, etc...

This commit is contained in:
bolero-MURAKAMI 2012-12-01 03:00:46 +09:00
parent 84e3348402
commit 86818d73cb
16 changed files with 207 additions and 157 deletions

View file

@ -10,7 +10,7 @@
#include <sprout/iterator/distance.hpp>
#include <sprout/iterator/type_traits/common.hpp>
#include <sprout/utility/swap.hpp>
#include <sprout/type_traits/arithmetic_promote.hpp>
#include <sprout/utility/limited.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
@ -242,7 +242,10 @@ namespace sprout {
sprout::alternate_iterator<LIterator2, RIterator2> const& rhs
)
{
return lhs.base() - rhs.base() + (lhs.is_in_left() ? (rhs.is_in_left() ? 0 : 1) : (rhs.is_in_left() ? 1 : 0));
return sprout::limited::plus(
sprout::limited::multiplies(lhs.base() - rhs.base(), 2),
lhs.is_in_left() ? (rhs.is_in_left() ? 0 : 1) : (rhs.is_in_left() ? 1 : 0)
);
}
template<typename LIterator, typename RIterator>
inline SPROUT_CONSTEXPR sprout::alternate_iterator<LIterator, RIterator> operator+(