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

Unified Diff: Source/wtf/RefPtr.h

Issue 354143005: Fix RefPtr's move assignment operator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Stop using std::move Created 6 years, 6 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 | Source/wtf/RefPtrTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/RefPtr.h
diff --git a/Source/wtf/RefPtr.h b/Source/wtf/RefPtr.h
index 424be1e99ad7aaa8302a93fbfb95d14fd30fbdc1..5b0ea80ca50452738cc18f9a247c814b02d3ffbf 100644
--- a/Source/wtf/RefPtr.h
+++ b/Source/wtf/RefPtr.h
@@ -111,7 +111,10 @@ namespace WTF {
#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES)
template<typename T> inline RefPtr<T>& RefPtr<T>::operator=(RefPtr&& o)
{
- swap(o);
+ // FIXME: Instead of explicitly casting to RefPtr&& here, we should use std::move, but that requires us to
+ // have a standard library that supports move semantics.
+ RefPtr ptr = static_cast<RefPtr&&>(o);
+ swap(ptr);
return *this;
}
#endif
« no previous file with comments | « no previous file | Source/wtf/RefPtrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698