mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
fix bug iterator/*.hpp assignment operator
This commit is contained in:
parent
787c819b77
commit
52a2178ac1
3 changed files with 14 additions and 14 deletions
|
@ -147,13 +147,13 @@ namespace sprout {
|
|||
}
|
||||
index_iterator& operator+=(difference_type n) {
|
||||
index_iterator temp(holder_, index_ + n);
|
||||
temp.swap(this);
|
||||
return this;
|
||||
temp.swap(*this);
|
||||
return *this;
|
||||
}
|
||||
index_iterator& operator-=(difference_type n) {
|
||||
index_iterator temp(holder_, index_ - n);
|
||||
temp.swap(this);
|
||||
return this;
|
||||
temp.swap(*this);
|
||||
return *this;
|
||||
}
|
||||
SPROUT_CONSTEXPR reference operator[](difference_type n) const {
|
||||
return holder_.get()[index_ + n];
|
||||
|
|
|
@ -47,8 +47,8 @@ namespace sprout {
|
|||
template<typename U>
|
||||
reverse_iterator& operator=(reverse_iterator<U> const& it) {
|
||||
reverse_iterator temp(it);
|
||||
temp.swap(this);
|
||||
return this;
|
||||
temp.swap(*this);
|
||||
return *this;
|
||||
}
|
||||
SPROUT_CONSTEXPR iterator_type base() const {
|
||||
return current;
|
||||
|
@ -89,13 +89,13 @@ namespace sprout {
|
|||
}
|
||||
reverse_iterator& operator+=(difference_type n) {
|
||||
reverse_iterator temp(current - n);
|
||||
temp.swap(this);
|
||||
return this;
|
||||
temp.swap(*this);
|
||||
return *this;
|
||||
}
|
||||
reverse_iterator& operator-=(difference_type n) {
|
||||
reverse_iterator temp(current + n);
|
||||
temp.swap(this);
|
||||
return this;
|
||||
temp.swap(*this);
|
||||
return *this;
|
||||
}
|
||||
SPROUT_CONSTEXPR reference operator[](difference_type n) const {
|
||||
return *(deref_tmp - n);
|
||||
|
|
|
@ -136,13 +136,13 @@ namespace sprout {
|
|||
}
|
||||
value_iterator& operator+=(difference_type n) {
|
||||
value_iterator temp(holder_, count_ - n);
|
||||
temp.swap(this);
|
||||
return this;
|
||||
temp.swap(*this);
|
||||
return *this;
|
||||
}
|
||||
value_iterator& operator-=(difference_type n) {
|
||||
value_iterator temp(holder_, count_ + n);
|
||||
temp.swap(this);
|
||||
return this;
|
||||
temp.swap(*this);
|
||||
return *this;
|
||||
}
|
||||
SPROUT_CONSTEXPR reference operator[](difference_type n) const {
|
||||
return holder_.get();
|
||||
|
|
Loading…
Reference in a new issue