From 3cd0b25ae65843013f35384ae19ef5a90bc10e41 Mon Sep 17 00:00:00 2001 From: Mitsuru Kariya Date: Wed, 4 Sep 2013 23:04:23 +0900 Subject: [PATCH] [testspr.reduct_iterator] Fix operator++, operator--, swap --- testspr/iterator.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/testspr/iterator.hpp b/testspr/iterator.hpp index 726bd736..a6113e5d 100644 --- a/testspr/iterator.hpp +++ b/testspr/iterator.hpp @@ -65,21 +65,21 @@ namespace testspr { return &*current; } reduct_iterator& operator++() { - --current; + ++current; return *this; } reduct_iterator operator++(int) { reduct_iterator result(*this); - --current; + ++current; return result; } reduct_iterator& operator--() { - ++current; + --current; return *this; } reduct_iterator operator--(int) { reduct_iterator temp(*this); - ++current; + --current; return temp; } SPROUT_CONSTEXPR reduct_iterator operator+(difference_type n) const { @@ -112,6 +112,7 @@ namespace testspr { SPROUT_NOEXCEPT_EXPR(swap(current, other.current)) ) { + using std::swap; swap(current, other.current); } };