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

Unified Diff: mojo/public/cpp/bindings/lib/iterator_util.h

Issue 1372233002: Fix |Array| and iterator_util.h's Iterator operator->() behavior (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 months 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 | « mojo/public/cpp/bindings/array.h ('k') | mojo/public/cpp/bindings/tests/iterator_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/iterator_util.h
diff --git a/mojo/public/cpp/bindings/lib/iterator_util.h b/mojo/public/cpp/bindings/lib/iterator_util.h
index 2a6ae3081ca3a8520dbb29d4bf4f106160f0ed16..071daa3cda205908d6361f0a2a7a89ad4504b0b0 100644
--- a/mojo/public/cpp/bindings/lib/iterator_util.h
+++ b/mojo/public/cpp/bindings/lib/iterator_util.h
@@ -63,7 +63,7 @@ class MapKeyIterator {
bool operator==(const Iterator& o) const { return o.it_ == it_; }
bool operator!=(const Iterator& o) const { return o.it_ != it_; }
typename Map<K, V>::KeyConstRefType operator*() { return it_.GetKey(); }
- typename Map<K, V>::KeyConstRefType operator->() { return operator*(); }
+ const K* operator->() { return &it_.GetKey(); }
private:
typename Map<K, V>::MapIterator it_;
@@ -108,7 +108,7 @@ class MapValueIterator {
bool operator==(const Iterator& o) const { return o.it_ == it_; }
bool operator!=(const Iterator& o) const { return o.it_ != it_; }
typename Map<K, V>::ValueRefType operator*() { return it_.GetValue(); }
- typename Map<K, V>::ValueRefType operator->() { return operator*(); }
+ V* operator->() { return &it_.GetValue(); }
private:
typename Map<K, V>::MapIterator it_;
« no previous file with comments | « mojo/public/cpp/bindings/array.h ('k') | mojo/public/cpp/bindings/tests/iterator_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698