Commit 4c2962cc authored by dcheng's avatar dcheng Committed by Commit bot

Implement the deference operator for scoped_refptr.

scoped_refptr previously got this for free since it implemented operator
T*, but the conversion operator is being removed. This prevents awkward
looking code like *my_favorite_pointer.get().

BUG=110610

Review URL: https://codereview.chromium.org/505943002

Cr-Commit-Position: refs/heads/master@{#291869}
parent 406524c9
......@@ -295,6 +295,11 @@ class scoped_refptr {
// and comparison operations.
operator T*() const { return ptr_; }
T& operator*() const {
assert(ptr_ != NULL);
return *ptr_;
}
T* operator->() const {
assert(ptr_ != NULL);
return ptr_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment