Implement move assignment in BasicWriter.

This commit is contained in:
Victor Zverovich
2014-04-26 07:10:21 -07:00
parent 515fd5218a
commit f153f6f4b5
2 changed files with 37 additions and 3 deletions
+7 -3
View File
@@ -174,18 +174,16 @@ class Array {
~Array() { Free(); }
#if FMT_USE_RVALUE_REFERENCES
Array(Array &&other) {
Move(other);
}
Array& operator=(Array&& other) {
Array& operator=(Array &&other) {
assert(this != &other);
Free();
Move(other);
return *this;
}
#endif
// Returns the size of this array.
@@ -922,6 +920,12 @@ class BasicWriter {
#if FMT_USE_RVALUE_REFERENCES
BasicWriter(BasicWriter &&other) : buffer_(std::move(other.buffer_)) {}
BasicWriter& operator=(BasicWriter &&other) {
assert(this != &other);
buffer_ = std::move(other.buffer_);
return *this;
}
#endif
/**