summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2016-06-06 19:29:55 -0400
committerMathias Stearn <mathias@10gen.com>2016-06-09 13:00:49 -0400
commit54a293b576d22775a57b0809a57b920283c436da (patch)
tree1630e1328260d64095c51648cc4a3a58602a86ca /src
parentccbcb85c68bf03f6ecc024a32a2b6c6a35c23c33 (diff)
downloadmongo-54a293b576d22775a57b0809a57b920283c436da.tar.gz
SERVER-24242 Make BSONObj nothow_move_constructible
Diffstat (limited to 'src')
-rw-r--r--src/mongo/bson/bsonobj.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/bson/bsonobj.h b/src/mongo/bson/bsonobj.h
index 58828a4254d..acd103edf2e 100644
--- a/src/mongo/bson/bsonobj.h
+++ b/src/mongo/bson/bsonobj.h
@@ -119,8 +119,8 @@ public:
_ownedBuffer(std::move(ownedBuffer)) {}
/** Move construct a BSONObj */
- BSONObj(BSONObj&& other)
- : _objdata(std::move(other._objdata)), _ownedBuffer(std::move(other._ownedBuffer)) {
+ BSONObj(BSONObj&& other) noexcept : _objdata(std::move(other._objdata)),
+ _ownedBuffer(std::move(other._ownedBuffer)) {
other._objdata = BSONObj()._objdata; // To return to an empty state.
dassert(!other.isOwned());
}
@@ -134,13 +134,13 @@ public:
/** Provide assignment semantics. We use the value taking form so that we can use copy
* and swap, and consume both lvalue and rvalue references.
*/
- BSONObj& operator=(BSONObj otherCopy) {
+ BSONObj& operator=(BSONObj otherCopy) noexcept {
this->swap(otherCopy);
return *this;
}
/** Swap this BSONObj with 'other' */
- void swap(BSONObj& other) {
+ void swap(BSONObj& other) noexcept {
using std::swap;
swap(_objdata, other._objdata);
swap(_ownedBuffer, other._ownedBuffer);
@@ -595,7 +595,7 @@ std::ostream& operator<<(std::ostream& s, const BSONElement& e);
StringBuilder& operator<<(StringBuilder& s, const BSONObj& o);
StringBuilder& operator<<(StringBuilder& s, const BSONElement& e);
-inline void swap(BSONObj& l, BSONObj& r) {
+inline void swap(BSONObj& l, BSONObj& r) noexcept {
l.swap(r);
}