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

Unified Diff: webrtc/system_wrappers/include/scoped_vector.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/scoped_ptr.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/system_wrappers/include/scoped_vector.h
diff --git a/webrtc/system_wrappers/include/scoped_vector.h b/webrtc/system_wrappers/include/scoped_vector.h
index 7336d98a86de996ce4a27577b0a7a678c10798a7..284f437259e9776577ab78d6de03b5b2c39bcf4b 100644
--- a/webrtc/system_wrappers/include/scoped_vector.h
+++ b/webrtc/system_wrappers/include/scoped_vector.h
@@ -43,9 +43,7 @@ class ScopedVector {
~ScopedVector() { clear(); }
// Move construction and assignment.
- ScopedVector(ScopedVector&& other) {
- *this = static_cast<ScopedVector&&>(other);
- }
+ ScopedVector(ScopedVector&& other) { *this = std::move(other); }
ScopedVector& operator=(ScopedVector&& other) {
std::swap(v_, other.v_); // The arguments are std::vectors, so std::swap
// is the one that we want.
@@ -58,7 +56,7 @@ class ScopedVector {
ScopedVector& operator=(const ScopedVector& other) = delete;
// Get an rvalue reference. (sv.Pass() does the same thing as std::move(sv).)
- ScopedVector&& Pass() { return static_cast<ScopedVector&&>(*this); }
+ ScopedVector&& Pass() { return std::move(*this); }
reference operator[](size_t index) { return v_[index]; }
const_reference operator[](size_t index) const { return v_[index]; }
« no previous file with comments | « webrtc/base/scoped_ptr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698