From e588c4925a9d95130c1765b680241eb49ed1f94d Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Sun, 25 Nov 2012 14:38:49 +0900 Subject: [PATCH] fix alternate_iterator --- sprout/iterator/alternate_iterator.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sprout/iterator/alternate_iterator.hpp b/sprout/iterator/alternate_iterator.hpp index bda8c619..25d5fd5a 100644 --- a/sprout/iterator/alternate_iterator.hpp +++ b/sprout/iterator/alternate_iterator.hpp @@ -41,7 +41,7 @@ namespace sprout { bool in_left; private: SPROUT_CONSTEXPR alternate_iterator advance_impl_1(difference_type n) const { - return alternate_iterator(sprout::next(current1, n / 2), sprout::next(current2, n / 2), n % 2); + return alternate_iterator(sprout::next(current1, n / 2), sprout::next(current2, n / 2), !(n % 2)); } SPROUT_CONSTEXPR alternate_iterator advance_impl(difference_type n) const { return advance_impl_1(n + (!is_in_left() ? 1 : 0));