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

Unified Diff: base/memory/weak_ptr.h

Issue 9455086: Make WeakPtr::operator* return reference instead of pointer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 8 years, 10 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 | « no previous file | base/memory/weak_ptr_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/weak_ptr.h
diff --git a/base/memory/weak_ptr.h b/base/memory/weak_ptr.h
index c0ba7f51c22691bda4c527b102ccfbc9fca35cb5..b66f02431aac2aa48bcf9babc396de3d8e055095 100644
--- a/base/memory/weak_ptr.h
+++ b/base/memory/weak_ptr.h
@@ -171,9 +171,9 @@ class WeakPtr : public internal::WeakPtrBase {
T* get() const { return ref_.is_valid() ? ptr_ : NULL; }
operator T*() const { return get(); }
- T* operator*() const {
+ T& operator*() const {
DCHECK(get() != NULL);
- return get();
+ return *get();
}
T* operator->() const {
DCHECK(get() != NULL);
« no previous file with comments | « no previous file | base/memory/weak_ptr_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698