Skip to content

Commit fb2d4f7

Browse files
authored
CXX-3043 Address additional Ro3/Ro5 violations (#1145)
1 parent 04e31f8 commit fb2d4f7

File tree

2 files changed

+23
-3
lines changed
  • src
    • bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic
    • mongocxx/lib/mongocxx/v_noabi/mongocxx/private

2 files changed

+23
-3
lines changed

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/array.hpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,22 @@ class array : public sub_array {
3939
///
4040
/// Default constructor
4141
///
42-
BSONCXX_INLINE array() : sub_array(&_core), _core(true) {}
42+
array() : sub_array(&_core), _core(true) {}
43+
44+
///
45+
/// Destructor
46+
///
47+
~array() = default;
4348

4449
///
4550
/// Move constructor
4651
///
47-
BSONCXX_INLINE array(array&& arr) noexcept : sub_array(&_core), _core(std::move(arr._core)) {}
52+
array(array&& arr) noexcept : sub_array(&_core), _core(std::move(arr._core)) {}
4853

4954
///
5055
/// Move assignment operator
5156
///
52-
BSONCXX_INLINE array& operator=(array&& arr) noexcept {
57+
array& operator=(array&& arr) noexcept {
5358
_core = std::move(arr._core);
5459
return *this;
5560
}

src/mongocxx/lib/mongocxx/v_noabi/mongocxx/private/index_view.hh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,24 @@ class index_view::impl {
261261
class scoped_server_description {
262262
public:
263263
explicit scoped_server_description(mongoc_server_description_t* sd) : sd(sd) {}
264+
264265
~scoped_server_description() {
265266
mongoc_server_description_destroy(sd);
266267
}
268+
269+
scoped_server_description(scoped_server_description&& other) : sd(other.sd) {
270+
other.sd = nullptr;
271+
}
272+
273+
scoped_server_description& operator=(scoped_server_description&& other) {
274+
sd = other.sd;
275+
other.sd = nullptr;
276+
return *this;
277+
}
278+
279+
scoped_server_description(const scoped_server_description&) = delete;
280+
scoped_server_description& operator=(const scoped_server_description&) = delete;
281+
267282
mongoc_server_description_t* sd;
268283
};
269284
};

0 commit comments

Comments
 (0)