This repository was archived by the owner on Oct 31, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +18
-2
lines changed Expand file tree Collapse file tree 5 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 3333#include < list>
3434#include < set>
3535#include < string>
36+ #include < type_traits>
3637#include < utility>
3738#include < vector>
3839
@@ -591,6 +592,9 @@ class BSONObj {
591592 ConstSharedBuffer _ownedBuffer;
592593};
593594
595+ MONGO_STATIC_ASSERT (std::is_nothrow_move_constructible_v<BSONObj>);
596+ MONGO_STATIC_ASSERT (std::is_nothrow_move_assignable_v<BSONObj>);
597+
594598std::ostream& operator <<(std::ostream& s, const BSONObj& o);
595599std::ostream& operator <<(std::ostream& s, const BSONElement& e);
596600
Original file line number Diff line number Diff line change 2929
3030#pragma once
3131
32+ #include < type_traits>
33+
3234#include " mongo/bson/bsonobj.h"
3335#include " mongo/util/shared_buffer.h"
3436
@@ -98,4 +100,7 @@ class RecordData {
98100 SharedBuffer _ownedData;
99101};
100102
103+ MONGO_STATIC_ASSERT (std::is_nothrow_move_constructible_v<RecordData>);
104+ MONGO_STATIC_ASSERT (std::is_nothrow_move_assignable_v<RecordData>);
105+
101106} // namespace mongo
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ if not has_option('noshell') and usemozjs:
8585 'mock_dbclient_conn_test.cpp' ,
8686 'mock_replica_set_test.cpp' ,
8787 'multikey_paths_test.cpp' ,
88- 'shared_buffer .cpp' ,
88+ 'shared_buffer_test .cpp' ,
8989 'pdfiletests.cpp' ,
9090 'plan_executor_invalidation_test.cpp' ,
9191 'plan_ranking.cpp' ,
Original file line number Diff line number Diff line change 2929
3030#include " mongo/platform/basic.h"
3131
32+ #include " mongo/util/shared_buffer.h"
33+
3234#include " mongo/base/string_data.h"
35+
3336#include " mongo/unittest/unittest.h"
34- #include " mongo/util/shared_buffer.h"
3537
3638namespace mongo {
3739namespace {
Original file line number Diff line number Diff line change 3030#pragma once
3131
3232#include < algorithm>
33+ #include < type_traits>
3334
3435#include < boost/intrusive_ptr.hpp>
3536
3637#include " mongo/platform/atomic_word.h"
38+
3739#include " mongo/util/allocator.h"
3840#include " mongo/util/assert_util.h"
3941
@@ -177,6 +179,9 @@ class SharedBuffer {
177179 boost::intrusive_ptr<Holder> _holder;
178180};
179181
182+ MONGO_STATIC_ASSERT (std::is_nothrow_move_constructible_v<SharedBuffer>);
183+ MONGO_STATIC_ASSERT (std::is_nothrow_move_assignable_v<SharedBuffer>);
184+
180185inline void swap (SharedBuffer& one, SharedBuffer& two) {
181186 one.swap (two);
182187}
You can’t perform that action at this time.
0 commit comments