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

Unified Diff: webrtc/base/scoped_ptr.h

Issue 1570473002: Replace manual casting to rvalue reference with calls to std::move (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 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 | « webrtc/base/optional_unittest.cc ('k') | webrtc/system_wrappers/include/scoped_vector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/scoped_ptr.h
diff --git a/webrtc/base/scoped_ptr.h b/webrtc/base/scoped_ptr.h
index db615f30895fef2c22c03ba9439453102feeb2ad..3f1a87a73c3d8b6697a4c92d6e11f2fb6cf406c8 100644
--- a/webrtc/base/scoped_ptr.h
+++ b/webrtc/base/scoped_ptr.h
@@ -374,7 +374,7 @@ class scoped_ptr {
scoped_ptr& operator=(const scoped_ptr& other) = delete;
// Get an rvalue reference. (sp.Pass() does the same thing as std::move(sp).)
- scoped_ptr&& Pass() { return static_cast<scoped_ptr&&>(*this); }
+ scoped_ptr&& Pass() { return std::move(*this); }
// Reset. Deletes the currently owned object, if any.
// Then takes ownership of a new object, if given.
@@ -507,7 +507,7 @@ class scoped_ptr<T[], D> {
scoped_ptr& operator=(const scoped_ptr& other) = delete;
// Get an rvalue reference. (sp.Pass() does the same thing as std::move(sp).)
- scoped_ptr&& Pass() { return static_cast<scoped_ptr&&>(*this); }
+ scoped_ptr&& Pass() { return std::move(*this); }
// Reset. Deletes the currently owned array, if any.
// Then takes ownership of a new object, if given.
« no previous file with comments | « webrtc/base/optional_unittest.cc ('k') | webrtc/system_wrappers/include/scoped_vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698