Fix autovector iterator increment/decrement comments
Summary: The prefix and postfix operators were mixed up in the autovector class. Test Plan: Inspection Reviewers: sdong, kailiu Reviewed By: kailiu Differential Revision: https://reviews.facebook.net/D21873
This commit is contained in:
parent
58b0f9d890
commit
f611935e9a
@ -67,26 +67,26 @@ class autovector {
|
|||||||
iterator_impl& operator=(const iterator_impl&) = default;
|
iterator_impl& operator=(const iterator_impl&) = default;
|
||||||
|
|
||||||
// -- Advancement
|
// -- Advancement
|
||||||
// iterator++
|
// ++iterator
|
||||||
self_type& operator++() {
|
self_type& operator++() {
|
||||||
++index_;
|
++index_;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ++iterator
|
// iterator++
|
||||||
self_type operator++(int) {
|
self_type operator++(int) {
|
||||||
auto old = *this;
|
auto old = *this;
|
||||||
++index_;
|
++index_;
|
||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
|
||||||
// iterator--
|
// --iterator
|
||||||
self_type& operator--() {
|
self_type& operator--() {
|
||||||
--index_;
|
--index_;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --iterator
|
// iterator--
|
||||||
self_type operator--(int) {
|
self_type operator--(int) {
|
||||||
auto old = *this;
|
auto old = *this;
|
||||||
--index_;
|
--index_;
|
||||||
|
Loading…
Reference in New Issue
Block a user