Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1147)

Unified Diff: content/browser/indexed_db/list_set.h

Issue 2570343002: operator* and and operator-> on iterators should be const (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/indexed_db/list_set.h
diff --git a/content/browser/indexed_db/list_set.h b/content/browser/indexed_db/list_set.h
index 86ef45bb97b29f323e96c4dab996ecd0dd3a24fc..ab46af20d6533c1c6d57f0ea30f7acc80a7dd270 100644
--- a/content/browser/indexed_db/list_set.h
+++ b/content/browser/indexed_db/list_set.h
@@ -70,34 +70,34 @@ class list_set {
public:
typedef iterator self_type;
typedef T value_type;
- typedef T& reference;
- typedef T* pointer;
+ typedef value_type& reference;
+ typedef value_type* pointer;
typedef std::bidirectional_iterator_tag iterator_category;
typedef std::ptrdiff_t difference_type;
- explicit inline iterator(typename std::list<T>::iterator it) : it_(it) {}
- inline self_type& operator++() {
+ explicit iterator(typename std::list<T>::iterator it) : it_(it) {}
+ self_type& operator++() {
++it_;
return *this;
}
- inline self_type operator++(int /*ignored*/) {
+ self_type operator++(int /*ignored*/) {
self_type result(*this);
++(*this);
return result;
}
- inline self_type& operator--() {
+ self_type& operator--() {
--it_;
return *this;
}
- inline self_type operator--(int /*ignored*/) {
+ self_type operator--(int /*ignored*/) {
self_type result(*this);
--(*this);
return result;
}
- inline value_type& operator*() { return *it_; }
- inline value_type* operator->() { return &(*it_); }
- inline bool operator==(const iterator& rhs) const { return it_ == rhs.it_; }
- inline bool operator!=(const iterator& rhs) const { return it_ != rhs.it_; }
+ reference operator*() const { return *it_; }
+ pointer operator->() const { return &(*it_); }
+ bool operator==(const iterator& rhs) const { return it_ == rhs.it_; }
+ bool operator!=(const iterator& rhs) const { return it_ != rhs.it_; }
inline operator const_iterator() const { return const_iterator(it_); }
@@ -109,39 +109,35 @@ class list_set {
public:
typedef const_iterator self_type;
typedef T value_type;
- typedef T& reference;
- typedef T* pointer;
+ typedef const value_type& reference;
+ typedef const value_type* pointer;
typedef std::bidirectional_iterator_tag iterator_category;
typedef std::ptrdiff_t difference_type;
explicit inline const_iterator(typename std::list<T>::const_iterator it)
: it_(it) {}
- inline self_type& operator++() {
+ self_type& operator++() {
++it_;
return *this;
}
- inline self_type operator++(int ignored) {
+ self_type operator++(int ignored) {
self_type result(*this);
++(*this);
return result;
}
- inline self_type& operator--() {
+ self_type& operator--() {
--it_;
return *this;
}
- inline self_type operator--(int ignored) {
+ self_type operator--(int ignored) {
self_type result(*this);
--(*this);
return result;
}
- inline const value_type& operator*() { return *it_; }
- inline const value_type* operator->() { return &(*it_); }
- inline bool operator==(const const_iterator& rhs) const {
- return it_ == rhs.it_;
- }
- inline bool operator!=(const const_iterator& rhs) const {
- return it_ != rhs.it_;
- }
+ reference operator*() const { return *it_; }
+ pointer operator->() const { return &(*it_); }
+ bool operator==(const const_iterator& rhs) const { return it_ == rhs.it_; }
+ bool operator!=(const const_iterator& rhs) const { return it_ != rhs.it_; }
private:
typename std::list<T>::const_iterator it_;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698