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

Unified Diff: base/move.h

Issue 1450013002: styleguide: Allow std::move for move semantics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added discussion thread link Created 5 years, 1 month 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 | styleguide/c++/c++11.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/move.h
diff --git a/base/move.h b/base/move.h
index 87dc52d16c554cf0588053e3d83a11e99e1375ed..ce8a8e13a7924fd92128d2dd1a2a4087c1f5a46a 100644
--- a/base/move.h
+++ b/base/move.h
@@ -5,6 +5,8 @@
#ifndef BASE_MOVE_H_
#define BASE_MOVE_H_
+#include <utility>
+
#include "base/compiler_specific.h"
// Macro with the boilerplate that makes a type move-only in C++03.
@@ -222,13 +224,13 @@
type(const type&); \
void operator=(const type&); \
public: \
- type&& Pass() WARN_UNUSED_RESULT { return static_cast<type&&>(*this); } \
+ type&& Pass() WARN_UNUSED_RESULT { return std::move(*this); } \
typedef void MoveOnlyTypeForCPP03; \
private:
#define TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(type) \
public: \
- type&& Pass() WARN_UNUSED_RESULT { return static_cast<type&&>(*this); } \
+ type&& Pass() WARN_UNUSED_RESULT { return std::move(*this); } \
private:
#endif // BASE_MOVE_H_
« no previous file with comments | « no previous file | styleguide/c++/c++11.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698