summaryrefslogtreecommitdiffstats
path: root/base/win
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2015-12-01 04:09:52 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-01 12:10:42 +0000
commite1b0277c20198c31b8782f567634552243182d08 (patch)
tree75fde33e5410051ddff4de64bbdd9766d294ef25 /base/win
parent7f54a6c611e793e47712cd4a988a46b5fbbdfd07 (diff)
downloadchromium_src-e1b0277c20198c31b8782f567634552243182d08.zip
chromium_src-e1b0277c20198c31b8782f567634552243182d08.tar.gz
chromium_src-e1b0277c20198c31b8782f567634552243182d08.tar.bz2
Remove old C++03 move emulation code.
Chrome allows the use of C++11 features now, so just use rvalue references directly. BUG=543901 Review URL: https://codereview.chromium.org/1407443002 Cr-Commit-Position: refs/heads/master@{#362394}
Diffstat (limited to 'base/win')
-rw-r--r--base/win/scoped_handle.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/base/win/scoped_handle.h b/base/win/scoped_handle.h
index d1eb1d6..3e8a748 100644
--- a/base/win/scoped_handle.h
+++ b/base/win/scoped_handle.h
@@ -36,7 +36,7 @@ namespace win {
// this explicitly is necessary because of bug 528394 and VC++ 2015.
template <class Traits, class Verifier>
class GenericScopedHandle {
- MOVE_ONLY_TYPE_FOR_CPP_03(GenericScopedHandle, RValue)
+ MOVE_ONLY_TYPE_FOR_CPP_03(GenericScopedHandle)
public:
typedef typename Traits::Handle Handle;
@@ -47,9 +47,9 @@ class GenericScopedHandle {
Set(handle);
}
- // Move constructor for C++03 move emulation of this type.
- GenericScopedHandle(RValue other) : handle_(Traits::NullHandle()) {
- Set(other.object->Take());
+ GenericScopedHandle(GenericScopedHandle&& other)
+ : handle_(Traits::NullHandle()) {
+ Set(other.Take());
}
~GenericScopedHandle() {
@@ -60,11 +60,9 @@ class GenericScopedHandle {
return Traits::IsHandleValid(handle_);
}
- // Move operator= for C++03 move emulation of this type.
- GenericScopedHandle& operator=(RValue other) {
- if (this != other.object) {
- Set(other.object->Take());
- }
+ GenericScopedHandle& operator=(GenericScopedHandle&& other) {
+ DCHECK_NE(this, &other);
+ Set(other.Take());
return *this;
}