summaryrefslogtreecommitdiffstats
path: root/remoting/base
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 /remoting/base
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 'remoting/base')
-rw-r--r--remoting/base/typed_buffer.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/remoting/base/typed_buffer.h b/remoting/base/typed_buffer.h
index c80f720..fd46646 100644
--- a/remoting/base/typed_buffer.h
+++ b/remoting/base/typed_buffer.h
@@ -10,6 +10,7 @@
#include <algorithm>
#include "base/basictypes.h"
+#include "base/logging.h"
#include "base/move.h"
namespace remoting {
@@ -20,11 +21,10 @@ namespace remoting {
// move-only semantics and typed buffer getters.
template <typename T>
class TypedBuffer {
- MOVE_ONLY_TYPE_FOR_CPP_03(TypedBuffer, RValue)
+ MOVE_ONLY_TYPE_FOR_CPP_03(TypedBuffer)
public:
- TypedBuffer() : buffer_(NULL), length_(0) {
- }
+ TypedBuffer() : TypedBuffer(0) {}
// Creates an instance of the object allocating a buffer of the given size.
explicit TypedBuffer(uint32 length) : buffer_(NULL), length_(length) {
@@ -32,12 +32,7 @@ class TypedBuffer {
buffer_ = reinterpret_cast<T*>(new uint8[length_]);
}
- // Move constructor for C++03 move emulation of this type.
- TypedBuffer(RValue rvalue) : buffer_(NULL), length_(0) {
- TypedBuffer temp;
- temp.Swap(*rvalue.object);
- Swap(temp);
- }
+ TypedBuffer(TypedBuffer&& rvalue) : TypedBuffer() { Swap(rvalue); }
~TypedBuffer() {
if (buffer_) {
@@ -46,11 +41,8 @@ class TypedBuffer {
}
}
- // Move operator= for C++03 move emulation of this type.
- TypedBuffer& operator=(RValue rvalue) {
- TypedBuffer temp;
- temp.Swap(*rvalue.object);
- Swap(temp);
+ TypedBuffer& operator=(TypedBuffer&& rvalue) {
+ Swap(rvalue);
return *this;
}