diff options
Diffstat (limited to 'webrtc/system_wrappers/include/scoped_vector.h')
-rw-r--r-- | webrtc/system_wrappers/include/scoped_vector.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/webrtc/system_wrappers/include/scoped_vector.h b/webrtc/system_wrappers/include/scoped_vector.h index 1e89a9d245..15c3380c8c 100644 --- a/webrtc/system_wrappers/include/scoped_vector.h +++ b/webrtc/system_wrappers/include/scoped_vector.h @@ -10,12 +10,13 @@ // Borrowed from Chromium's src/base/memory/scoped_vector.h. -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_VECTOR_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_VECTOR_H_ +#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_SCOPED_VECTOR_H_ +#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_SCOPED_VECTOR_H_ #include <vector> #include "webrtc/base/checks.h" +#include "webrtc/base/deprecation.h" #include "webrtc/system_wrappers/include/stl_util.h" namespace webrtc { @@ -43,9 +44,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 +57,11 @@ 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); } + // Deprecated; remove in March 2016 (bug 5373). + RTC_DEPRECATED ScopedVector&& Pass() { return DEPRECATED_Pass(); } + ScopedVector&& DEPRECATED_Pass() { + return std::move(*this); + } reference operator[](size_t index) { return v_[index]; } const_reference operator[](size_t index) const { return v_[index]; } @@ -154,4 +157,4 @@ class ScopedVector { } // namespace webrtc -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_VECTOR_H_ +#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_SCOPED_VECTOR_H_ |