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

Unified Diff: base/scoped_generic.h

Issue 995093002: Add additional move support to ScopedGeneric in the form of operator=. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/scoped_generic_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/scoped_generic.h
diff --git a/base/scoped_generic.h b/base/scoped_generic.h
index da42609e5c484cefc5024f9968f836ea0292eecc..4fad2ceb8e09863a073d8165e3b93e4276599f93 100644
--- a/base/scoped_generic.h
+++ b/base/scoped_generic.h
@@ -92,6 +92,11 @@ class ScopedGeneric {
FreeIfNecessary();
}
+ ScopedGeneric& operator=(ScopedGeneric<T, Traits>&& rhs) {
danakj 2015/03/10 20:29:13 If we're going to add rvalue references we should
Robert Sesek 2015/03/10 20:51:15 OK, replaced the emulated move with full C++11 mov
+ reset(rhs.release());
+ return *this;
+ }
+
// Frees the currently owned object, if any. Then takes ownership of a new
// object, if given. Self-resets are not allowd as on scoped_ptr. See
// http://crbug.com/162971
« no previous file with comments | « no previous file | base/scoped_generic_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698