Skip to content

Commit

Permalink
noexcept support for move ops
Browse files Browse the repository at this point in the history
  • Loading branch information
idealvin committed Feb 24, 2020
1 parent d214002 commit b3c0779
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions base/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ class Value {
if (_mem) this->_Ref();
}

Value(Value&& v) {
_mem = v._mem;
Value(Value&& v) noexcept : _mem(v._mem) {
v._mem = 0;
}

Expand All @@ -131,7 +130,7 @@ class Value {
return *this;
}

Value& operator=(Value&& v) {
Value& operator=(Value&& v) noexcept {
if (_mem) this->reset();
_mem = v._mem;
v._mem = 0;
Expand Down

0 comments on commit b3c0779

Please sign in to comment.