mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
Merge pull request #37 from kariya-mitsuru/testspr.reduct_iterator
[testspr.reduct_iterator] Fix operator++, operator--, swap
This commit is contained in:
commit
e179cefdac
1 changed files with 5 additions and 4 deletions
|
@ -65,21 +65,21 @@ namespace testspr {
|
||||||
return &*current;
|
return &*current;
|
||||||
}
|
}
|
||||||
reduct_iterator& operator++() {
|
reduct_iterator& operator++() {
|
||||||
--current;
|
++current;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
reduct_iterator operator++(int) {
|
reduct_iterator operator++(int) {
|
||||||
reduct_iterator result(*this);
|
reduct_iterator result(*this);
|
||||||
--current;
|
++current;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
reduct_iterator& operator--() {
|
reduct_iterator& operator--() {
|
||||||
++current;
|
--current;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
reduct_iterator operator--(int) {
|
reduct_iterator operator--(int) {
|
||||||
reduct_iterator temp(*this);
|
reduct_iterator temp(*this);
|
||||||
++current;
|
--current;
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR reduct_iterator operator+(difference_type n) const {
|
SPROUT_CONSTEXPR reduct_iterator operator+(difference_type n) const {
|
||||||
|
@ -112,6 +112,7 @@ namespace testspr {
|
||||||
SPROUT_NOEXCEPT_EXPR(swap(current, other.current))
|
SPROUT_NOEXCEPT_EXPR(swap(current, other.current))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
using std::swap;
|
||||||
swap(current, other.current);
|
swap(current, other.current);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue