diff --git a/CHANGELOG.md b/CHANGELOG.md index e4eca015ef..ff4f23f8b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Changes prior to 3.9.0 are documented as [release notes on GitHub](https://githu - Use `bsoncxx::stdx::optional` instead of `mongocxx::stdx::optional`. - Use `bsoncxx::stdx::string_view` instead of `mongocxx::stdx::string_view`. - Inline namespace macros for bsoncxx and mongocxx namespace: `*_INLINE_NAMESPACE_*`. +- The `` header. - The `` header. - The `` header. - The `` header. diff --git a/benchmark/benchmark_runner.cpp b/benchmark/benchmark_runner.cpp index c448184f8c..a4c1cd7c96 100644 --- a/benchmark/benchmark_runner.cpp +++ b/benchmark/benchmark_runner.cpp @@ -14,14 +14,6 @@ #include "benchmark_runner.hpp" -#include -#include -#include -#include -#include -#include -#include - #include "bson/bson_encoding.hpp" #include "multi_doc/bulk_insert.hpp" #include "multi_doc/find_many.hpp" @@ -34,55 +26,62 @@ #include "single_doc/find_one_by_id.hpp" #include "single_doc/insert_one.hpp" #include "single_doc/run_command.hpp" + +#include +#include +#include +#include +#include +#include +#include + #include #include #include #include #include -#include #include namespace benchmark { // The task sizes and iteration numbers come from the Driver Perfomance Benchmarking Reference Doc. benchmark_runner::benchmark_runner(std::set types) : _types{types} { - using bsoncxx::stdx::make_unique; - // Bson microbenchmarks _microbenches.push_back( - make_unique("TestFlatEncoding", 75.31, "extended_bson/flat_bson.json")); + std::make_unique("TestFlatEncoding", 75.31, "extended_bson/flat_bson.json")); _microbenches.push_back( - make_unique("TestDeepEncoding", 19.64, "extended_bson/deep_bson.json")); + std::make_unique("TestDeepEncoding", 19.64, "extended_bson/deep_bson.json")); _microbenches.push_back( - make_unique("TestFullEncoding", 57.34, "extended_bson/full_bson.json")); + std::make_unique("TestFullEncoding", 57.34, "extended_bson/full_bson.json")); // TODO CXX-1241: Add bson_decoding equivalents. // Single doc microbenchmarks - _microbenches.push_back(make_unique()); - _microbenches.push_back(make_unique("single_and_multi_document/tweet.json")); - _microbenches.push_back(make_unique( + _microbenches.push_back(std::make_unique()); + _microbenches.push_back( + std::make_unique("single_and_multi_document/tweet.json")); + _microbenches.push_back(std::make_unique( "TestSmallDocInsertOne", 2.75, iterations, "single_and_multi_document/small_doc.json")); - _microbenches.push_back(make_unique( + _microbenches.push_back(std::make_unique( "TestLargeDocInsertOne", 27.31, 10, "single_and_multi_document/large_doc.json")); // Multi doc microbenchmarks - _microbenches.push_back(make_unique("single_and_multi_document/tweet.json")); - _microbenches.push_back(make_unique( + _microbenches.push_back(std::make_unique("single_and_multi_document/tweet.json")); + _microbenches.push_back(std::make_unique( "TestSmallDocBulkInsert", 2.75, iterations, "single_and_multi_document/small_doc.json")); - _microbenches.push_back(make_unique( + _microbenches.push_back(std::make_unique( "TestLargeDocBulkInsert", 27.31, 10, "single_and_multi_document/large_doc.json")); // CXX-2794: Disable GridFS benchmarks due to long runtime // _microbenches.push_back( - // make_unique("single_and_multi_document/gridfs_large.bin")); + // std::make_unique("single_and_multi_document/gridfs_large.bin")); // _microbenches.push_back( - // make_unique("single_and_multi_document/gridfs_large.bin")); + // std::make_unique("single_and_multi_document/gridfs_large.bin")); // Parallel microbenchmarks - _microbenches.push_back(make_unique("parallel/ldjson_multi")); - _microbenches.push_back(make_unique("parallel/ldjson_multi")); + _microbenches.push_back(std::make_unique("parallel/ldjson_multi")); + _microbenches.push_back(std::make_unique("parallel/ldjson_multi")); // CXX-2794: Disable GridFS benchmarks due to long runtime - // _microbenches.push_back(make_unique("parallel/gridfs_multi")); - // _microbenches.push_back(make_unique("parallel/gridfs_multi")); + // _microbenches.push_back(std::make_unique("parallel/gridfs_multi")); + // _microbenches.push_back(std::make_unique("parallel/gridfs_multi")); // Need to remove some if (!_types.empty()) { diff --git a/benchmark/multi_doc/gridfs_download.hpp b/benchmark/multi_doc/gridfs_download.hpp index 7365fcbc6e..da05aac50a 100644 --- a/benchmark/multi_doc/gridfs_download.hpp +++ b/benchmark/multi_doc/gridfs_download.hpp @@ -14,12 +14,14 @@ #pragma once +#include "../microbench.hpp" + #include #include +#include -#include "../microbench.hpp" -#include #include + #include #include #include @@ -29,7 +31,6 @@ namespace benchmark { using bsoncxx::builder::basic::kvp; using bsoncxx::builder::basic::make_document; -using bsoncxx::stdx::make_unique; class gridfs_download : public microbench { public: @@ -74,7 +75,7 @@ void gridfs_download::task() { auto file_length = downloader.file_length(); auto buffer_size = std::min(file_length, static_cast(downloader.chunk_size())); - auto buffer = make_unique(static_cast(buffer_size)); + auto buffer = std::make_unique(static_cast(buffer_size)); while ([[maybe_unused]] auto length_read = downloader.read(buffer.get(), static_cast(buffer_size))) { diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/value.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/value.hpp index 166405f6d7..422711e96b 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/value.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/value.hpp @@ -24,7 +24,6 @@ #include #include -#include #include #include diff --git a/src/bsoncxx/lib/CMakeLists.txt b/src/bsoncxx/lib/CMakeLists.txt index 26c849b65a..3188da6fa4 100644 --- a/src/bsoncxx/lib/CMakeLists.txt +++ b/src/bsoncxx/lib/CMakeLists.txt @@ -77,6 +77,7 @@ set_dist_list(src_bsoncxx_lib_DIST bsoncxx/v_noabi/bsoncxx/config/version.hpp.in bsoncxx/v_noabi/bsoncxx/private/b64_ntop.hh bsoncxx/v_noabi/bsoncxx/private/helpers.hh + bsoncxx/v_noabi/bsoncxx/private/make_unique.hh bsoncxx/v_noabi/bsoncxx/private/itoa.hh bsoncxx/v_noabi/bsoncxx/private/libbson.hh bsoncxx/v_noabi/bsoncxx/private/stack.hh diff --git a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/builder/core.cpp b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/builder/core.cpp index 747b47cb62..d1bc5e2c56 100644 --- a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/builder/core.cpp +++ b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/builder/core.cpp @@ -19,9 +19,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -256,7 +256,7 @@ class core::impl { }; core::core(bool is_array) { - _impl = stdx::make_unique(is_array); + _impl = make_unique(is_array); } core::core(core&&) noexcept = default; diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/make_unique.hpp b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/private/make_unique.hh similarity index 78% rename from src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/make_unique.hpp rename to src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/private/make_unique.hh index cbc4a5484d..757cb03292 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/make_unique.hpp +++ b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/private/make_unique.hh @@ -36,8 +36,6 @@ #include namespace bsoncxx { -namespace v_noabi { -namespace stdx { namespace detail { // Switch backend of make_unique by the type we are creating. @@ -95,21 +93,17 @@ template struct make_unique_impl {}; } // namespace detail -} // namespace stdx -} // namespace v_noabi } // namespace bsoncxx #endif // !defined(BSONCXX_DETAIL_USE_STD_MAKE_UNIQUE) || // !defined(__cpp_lib_smart_ptr_for_overwrite) namespace bsoncxx { -namespace v_noabi { -namespace stdx { // Unlike other C++17 polyfill features, this is a C++14 feature. // Use feature testing rather than polyfill library selection macros. #if defined(BSONCXX_DETAIL_USE_STD_MAKE_UNIQUE) -using ::std::make_unique; +using std::make_unique; #else // Equivalent to `std::make_unique(args...)` where `T` is a non-array type. @@ -143,7 +137,7 @@ std::unique_ptr make_unique(std::size_t count) { // Unlike other C++17 polyfill features, this is a C++20 feature. // Use feature testing rather than polyfill library selection macros. #if defined(__cpp_lib_smart_ptr_for_overwrite) -using ::std::make_unique_for_overwrite; +using std::make_unique_for_overwrite; #else // Equivalent to `std::make_unique_for_overwrite()` where `T` is a non-array type. @@ -168,68 +162,8 @@ std::unique_ptr make_unique_for_overwrite(std::size_t count) { #endif -} // namespace stdx -} // namespace v_noabi } // namespace bsoncxx #pragma pop_macro("BSONCXX_DETAIL_USE_STD_MAKE_UNIQUE") #include - -namespace bsoncxx { -namespace stdx { - -using ::bsoncxx::v_noabi::stdx::make_unique; -using ::bsoncxx::v_noabi::stdx::make_unique_for_overwrite; - -} // namespace stdx -} // namespace bsoncxx - -/// -/// @file -/// Provides `std::make_unique`-related polyfills for internal use. -/// -/// @deprecated Primarily for internal use; will be removed in an upcoming major release. -/// - -#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) - -namespace bsoncxx { -namespace v_noabi { -namespace stdx { - -/// -/// Equivalent to `std::make_unique` for non-array types. -/// -/// @deprecated Primarily for internal use; will be removed in an upcoming major release. -/// -template -std::unique_ptr make_unique(Args&&... args); - -/// -/// Equivalent to `std::make_unique` for array types. -/// -/// @deprecated Primarily for internal use. Will be removed in an upcoming major release. -/// -template -std::unique_ptr make_unique(std::size_t count); - -} // namespace stdx -} // namespace v_noabi -} // namespace bsoncxx - -namespace bsoncxx { -namespace stdx { - -/// @ref bsoncxx::v_noabi::stdx::make_unique(Args&&... args) -template -std::unique_ptr make_unique(Args&&... args); - -/// @ref bsoncxx::v_noabi::stdx::make_unique(std::size_t count) -template -std::unique_ptr make_unique(std::size_t count); - -} // namespace stdx -} // namespace bsoncxx - -#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/types/bson_value/value.cpp b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/types/bson_value/value.cpp index cebc544bea..0470ede925 100644 --- a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/types/bson_value/value.cpp +++ b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/types/bson_value/value.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include @@ -27,19 +27,19 @@ namespace types { namespace bson_value { value::value(b_double v) : value(v.value) {} -value::value(double v) : _impl{stdx::make_unique()} { +value::value(double v) : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_DOUBLE; _impl->_value.value.v_double = v; } value::value(b_int32 v) : value(v.value) {} -value::value(int32_t v) : _impl{stdx::make_unique()} { +value::value(int32_t v) : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_INT32; _impl->_value.value.v_int32 = v; } value::value(b_int64 v) : value(v.value) {} -value::value(int64_t v) : _impl{stdx::make_unique()} { +value::value(int64_t v) : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_INT64; _impl->_value.value.v_int64 = v; } @@ -47,31 +47,31 @@ value::value(int64_t v) : _impl{stdx::make_unique()} { value::value(const char* v) : value(stdx::string_view{v}) {} value::value(std::string v) : value(stdx::string_view{v}) {} value::value(b_string v) : value(v.value) {} -value::value(stdx::string_view v) : _impl{stdx::make_unique()} { +value::value(stdx::string_view v) : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_UTF8; _impl->_value.value.v_utf8.str = make_copy_for_libbson(v); _impl->_value.value.v_utf8.len = static_cast(v.size()); } value::value(b_null) : value(nullptr) {} -value::value(std::nullptr_t) : _impl{stdx::make_unique()} { +value::value(std::nullptr_t) : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_NULL; } value::value(b_date v) : value(v.value) {} -value::value(std::chrono::milliseconds v) : _impl{stdx::make_unique()} { +value::value(std::chrono::milliseconds v) : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_DATE_TIME; _impl->_value.value.v_datetime = v.count(); } value::value(b_oid v) : value(v.value) {} -value::value(oid v) : _impl{stdx::make_unique()} { +value::value(oid v) : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_OID; std::memcpy(_impl->_value.value.v_oid.bytes, v.bytes(), v.k_oid_length); } value::value(b_bool v) : value(v.value) {} -value::value(bool v) : _impl{stdx::make_unique()} { +value::value(bool v) : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_BOOL; _impl->_value.value.v_bool = v; } @@ -79,7 +79,7 @@ value::value(bool v) : _impl{stdx::make_unique()} { value::value(b_maxkey) : value(type::k_maxkey) {} value::value(b_minkey) : value(type::k_minkey) {} value::value(b_undefined) : value(type::k_undefined) {} -value::value(const type id) : _impl{stdx::make_unique()} { +value::value(const type id) : _impl{make_unique()} { switch (id) { case type::k_minkey: _impl->_value.value_type = BSON_TYPE_MINKEY; @@ -115,8 +115,7 @@ value::value(const type id) : _impl{stdx::make_unique()} { } value::value(b_regex v) : value(v.regex, v.options) {} -value::value(stdx::string_view regex, stdx::string_view options) - : _impl{stdx::make_unique()} { +value::value(stdx::string_view regex, stdx::string_view options) : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_REGEX; _impl->_value.value.v_regex.regex = make_copy_for_libbson(regex); _impl->_value.value.v_regex.options = @@ -125,7 +124,7 @@ value::value(stdx::string_view regex, stdx::string_view options) value::value(b_code v) : value(v.type_id, v) {} value::value(b_symbol v) : value(v.type_id, v) {} -value::value(const type id, stdx::string_view v) : _impl{stdx::make_unique()} { +value::value(const type id, stdx::string_view v) : _impl{make_unique()} { switch (id) { case type::k_regex: _impl->_value.value_type = BSON_TYPE_REGEX; @@ -169,7 +168,7 @@ value::value(const type id, stdx::string_view v) : _impl{stdx::make_unique value::value(b_decimal128 v) : value(v.value) {} value::value(decimal128 v) : value(type::k_decimal128, v.high(), v.low()) {} value::value(b_timestamp v) : value(v.type_id, v.increment, v.timestamp) {} -value::value(type id, uint64_t a, uint64_t b) : _impl{stdx::make_unique()} { +value::value(type id, uint64_t a, uint64_t b) : _impl{make_unique()} { switch (id) { case type::k_decimal128: _impl->_value.value_type = BSON_TYPE_DECIMAL128; @@ -207,7 +206,7 @@ value::value(type id, uint64_t a, uint64_t b) : _impl{stdx::make_unique()} } value::value(b_dbpointer v) : value(v.collection, v.value) {} -value::value(stdx::string_view collection, oid value) : _impl{stdx::make_unique()} { +value::value(stdx::string_view collection, oid value) : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_DBPOINTER; _impl->_value.value.v_dbpointer.collection = make_copy_for_libbson(collection); _impl->_value.value.v_dbpointer.collection_len = static_cast(collection.length()); @@ -216,7 +215,7 @@ value::value(stdx::string_view collection, oid value) : _impl{stdx::make_unique< value::value(b_codewscope v) : value(v.code, v.scope) {} value::value(stdx::string_view code, bsoncxx::v_noabi::document::view_or_value scope) - : _impl{stdx::make_unique()} { + : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_CODEWSCOPE; _impl->_value.value.v_codewscope.code = make_copy_for_libbson(code); _impl->_value.value.v_codewscope.code_len = static_cast(code.length()); @@ -231,7 +230,7 @@ value::value(b_binary v) : value(v.bytes, v.size, v.sub_type) {} value::value(std::vector v, binary_sub_type sub_type) : value(v.data(), v.size(), sub_type) {} value::value(const uint8_t* data, size_t size, const binary_sub_type sub_type) - : _impl{stdx::make_unique()} { + : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_BINARY; _impl->_value.value.v_binary.subtype = static_cast(sub_type); _impl->_value.value.v_binary.data_len = static_cast(size); @@ -241,7 +240,7 @@ value::value(const uint8_t* data, size_t size, const binary_sub_type sub_type) } value::value(b_document v) : value(v.view()) {} -value::value(bsoncxx::v_noabi::document::view v) : _impl{stdx::make_unique()} { +value::value(bsoncxx::v_noabi::document::view v) : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_DOCUMENT; _impl->_value.value.v_doc.data_len = static_cast(v.length()); _impl->_value.value.v_doc.data = static_cast(bson_malloc(v.length())); @@ -249,7 +248,7 @@ value::value(bsoncxx::v_noabi::document::view v) : _impl{stdx::make_unique } value::value(b_array v) : value(v.value) {} -value::value(bsoncxx::v_noabi::array::view v) : _impl{stdx::make_unique()} { +value::value(bsoncxx::v_noabi::array::view v) : _impl{make_unique()} { _impl->_value.value_type = BSON_TYPE_ARRAY; _impl->_value.value.v_doc.data_len = static_cast(v.length()); _impl->_value.value.v_doc.data = static_cast(bson_malloc(v.length())); @@ -271,16 +270,16 @@ value::value(const std::uint8_t* raw, bson_iter_init_from_data_at_offset(&iter, raw, length, offset, keylen); auto value = bson_iter_value(&iter); - _impl = stdx::make_unique(value); + _impl = make_unique(value); } value::value(void* internal_value) - : _impl(stdx::make_unique(static_cast(internal_value))) {} + : _impl(make_unique(static_cast(internal_value))) {} value::value(const value& rhs) : value(&rhs._impl->_value) {} value::value(const bson_value::view& bson_view) { - _impl = stdx::make_unique(); + _impl = make_unique(); convert_to_libbson(&_impl->_value, bson_view); } diff --git a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/validate.cpp b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/validate.cpp index 77bd12ec5c..794af24f66 100644 --- a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/validate.cpp +++ b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/validate.cpp @@ -13,7 +13,7 @@ // limitations under the License. #include -#include +#include #include #include @@ -28,7 +28,7 @@ struct validator::impl { bool _check_dot_keys{false}; }; -validator::validator() : _impl{stdx::make_unique()} {} +validator::validator() : _impl{make_unique()} {} validator::~validator() = default; diff --git a/src/bsoncxx/test/array.cpp b/src/bsoncxx/test/array.cpp index bfad640fbb..690c1db849 100644 --- a/src/bsoncxx/test/array.cpp +++ b/src/bsoncxx/test/array.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include #include #include diff --git a/src/bsoncxx/test/make_unique.test.cpp b/src/bsoncxx/test/make_unique.test.cpp index a71792448e..3ada37e5bc 100644 --- a/src/bsoncxx/test/make_unique.test.cpp +++ b/src/bsoncxx/test/make_unique.test.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include @@ -14,18 +14,18 @@ struct something { }; TEST_CASE("Create a unique_ptr") { - auto ptr = bsoncxx::stdx::make_unique(12); + auto ptr = bsoncxx::make_unique(12); REQUIRE(ptr); CHECK(*ptr == 12); - auto thing = bsoncxx::stdx::make_unique(5); + auto thing = bsoncxx::make_unique(5); REQUIRE(thing); CHECK(thing->value == 5); } TEST_CASE("Create a unique_ptr") { const unsigned length = 12; - auto ptr = bsoncxx::stdx::make_unique(length); + auto ptr = bsoncxx::make_unique(length); REQUIRE(ptr); // All elements are direct-initialized, which produces '0' for `int` CHECK(ptr[0] == 0); @@ -33,7 +33,7 @@ TEST_CASE("Create a unique_ptr") { CHECK(res.first == ptr.get()); CHECK(res.second == (ptr.get() + length)); - ptr = bsoncxx::stdx::make_unique_for_overwrite(length); + ptr = bsoncxx::make_unique_for_overwrite(length); std::fill_n(ptr.get(), length, 42); CHECK(std::all_of(ptr.get(), ptr.get() + length, [](int n) { return n == 42; })); } diff --git a/src/bsoncxx/test/optional.test.cpp b/src/bsoncxx/test/optional.test.cpp index 8b84db945a..d9baaaea07 100644 --- a/src/bsoncxx/test/optional.test.cpp +++ b/src/bsoncxx/test/optional.test.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include @@ -481,7 +481,7 @@ TEST_CASE("optional: Nontrivial contents") { auto dup = std::move(aptr); CHECK(aptr == dup); } - aptr = bsoncxx::stdx::make_unique(31); + aptr = bsoncxx::make_unique(31); CHECK(aptr != nullopt); REQUIRE(aptr != nullptr); CHECK(**aptr == 31); diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/bulk_write.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/bulk_write.cpp index 98a672abe7..79afb1752e 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/bulk_write.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/bulk_write.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include @@ -225,7 +225,7 @@ bulk_write::bulk_write(const collection& coll, } scoped_bson_t bson_options(options_builder.extract()); - _impl = bsoncxx::v_noabi::stdx::make_unique( + _impl = bsoncxx::make_unique( libmongoc::collection_create_bulk_operation_with_opts(coll._get_impl().collection_t, bson_options.bson())); diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/change_stream.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/change_stream.cpp index 0444112e32..cc40d61bcc 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/change_stream.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/change_stream.cpp @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -62,8 +62,7 @@ bsoncxx::v_noabi::stdx::optional change_stream // void* since we don't leak C driver defs into C++ driver change_stream::change_stream(void* change_stream_ptr) - : _impl(bsoncxx::v_noabi::stdx::make_unique( - static_cast(change_stream_ptr))) {} + : _impl(bsoncxx::make_unique(static_cast(change_stream_ptr))) {} change_stream::iterator::iterator() : change_stream::iterator::iterator{iter_type::k_default_constructed, nullptr} {} diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client.cpp index f0b26f24a0..150c1435ee 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client.cpp @@ -13,7 +13,7 @@ // limitations under the License. #include -#include +#include #include #include @@ -90,7 +90,7 @@ client::client(const mongocxx::v_noabi::uri& uri, const options::client& options throw exception{error_code::k_invalid_parameter, "could not construct client from URI"}; } - _impl = bsoncxx::v_noabi::stdx::make_unique(std::move(new_client)); + _impl = bsoncxx::make_unique(std::move(new_client)); if (options.apm_opts()) { _impl->listeners = *options.apm_opts(); @@ -140,8 +140,7 @@ client::client(const mongocxx::v_noabi::uri& uri, const options::client& options } client::client(void* implementation) - : _impl{bsoncxx::v_noabi::stdx::make_unique( - static_cast<::mongoc_client_t*>(implementation))} {} + : _impl{bsoncxx::make_unique(static_cast<::mongoc_client_t*>(implementation))} {} client::client(client&&) noexcept = default; client& client::operator=(client&&) noexcept = default; @@ -163,8 +162,7 @@ void client::read_concern(mongocxx::v_noabi::read_concern rc) { mongocxx::v_noabi::read_concern client::read_concern() const { auto rc = libmongoc::client_get_read_concern(_get_impl().client_t); - return { - bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_concern_copy(rc))}; + return {bsoncxx::make_unique(libmongoc::read_concern_copy(rc))}; } void client::read_preference_deprecated(mongocxx::v_noabi::read_preference rp) { @@ -176,14 +174,13 @@ void client::read_preference(mongocxx::v_noabi::read_preference rp) { } mongocxx::v_noabi::read_preference client::read_preference() const { - mongocxx::v_noabi::read_preference rp( - bsoncxx::v_noabi::stdx::make_unique( - libmongoc::read_prefs_copy(libmongoc::client_get_read_prefs(_get_impl().client_t)))); + mongocxx::v_noabi::read_preference rp(bsoncxx::make_unique( + libmongoc::read_prefs_copy(libmongoc::client_get_read_prefs(_get_impl().client_t)))); return rp; } mongocxx::v_noabi::uri client::uri() const { - mongocxx::v_noabi::uri connection_string(bsoncxx::v_noabi::stdx::make_unique( + mongocxx::v_noabi::uri connection_string(bsoncxx::make_unique( libmongoc::uri_copy(libmongoc::client_get_uri(_get_impl().client_t)))); return connection_string; } @@ -197,7 +194,7 @@ void client::write_concern(mongocxx::v_noabi::write_concern wc) { } mongocxx::v_noabi::write_concern client::write_concern() const { - mongocxx::v_noabi::write_concern wc(bsoncxx::v_noabi::stdx::make_unique( + mongocxx::v_noabi::write_concern wc(bsoncxx::make_unique( libmongoc::write_concern_copy(libmongoc::client_get_write_concern(_get_impl().client_t)))); return wc; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_encryption.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_encryption.cpp index 792c140269..36a099aeb5 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_encryption.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_encryption.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #include #include @@ -26,7 +26,7 @@ namespace v_noabi { using mongocxx::libbson::scoped_bson_t; client_encryption::client_encryption(options::client_encryption opts) - : _impl(bsoncxx::v_noabi::stdx::make_unique(std::move(opts))) {} + : _impl(bsoncxx::make_unique(std::move(opts))) {} client_encryption::~client_encryption() = default; client_encryption::client_encryption(client_encryption&&) noexcept = default; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_session.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_session.cpp index e972b632c0..e2d17b0e37 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_session.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_session.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #include #include @@ -27,7 +27,7 @@ namespace v_noabi { // Private constructors. client_session::client_session(const mongocxx::v_noabi::client* client, const mongocxx::v_noabi::options::client_session& options) - : _impl(bsoncxx::v_noabi::stdx::make_unique(client, options)) {} + : _impl(bsoncxx::make_unique(client, options)) {} client_session::client_session(client_session&&) noexcept = default; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/collection.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/collection.cpp index 0d48b1e9f1..7cc0814774 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/collection.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/collection.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -70,7 +70,6 @@ using bsoncxx::v_noabi::document::view_or_value; namespace { -using bsoncxx::v_noabi::stdx::make_unique; using mongocxx::libbson::scoped_bson_t; const char* get_collection_name(mongoc_collection_t* collection) { @@ -265,20 +264,20 @@ void collection::rename( collection::collection(const database& database, bsoncxx::v_noabi::string::view_or_value collection_name) - : _impl(bsoncxx::v_noabi::stdx::make_unique( + : _impl(bsoncxx::make_unique( libmongoc::database_get_collection(database._get_impl().database_t, collection_name.terminated().data()), database.name(), database._get_impl().client_impl)) {} collection::collection(const database& database, void* collection) - : _impl(bsoncxx::v_noabi::stdx::make_unique(static_cast(collection), - database.name(), - database._get_impl().client_impl)) {} + : _impl(bsoncxx::make_unique(static_cast(collection), + database.name(), + database._get_impl().client_impl)) {} collection::collection(const collection& c) { if (c) { - _impl = bsoncxx::v_noabi::stdx::make_unique(c._get_impl()); + _impl = bsoncxx::make_unique(c._get_impl()); } } @@ -286,7 +285,7 @@ collection& collection::operator=(const collection& c) { if (!c) { _impl.reset(); } else if (!*this) { - _impl = bsoncxx::v_noabi::stdx::make_unique(c._get_impl()); + _impl = bsoncxx::make_unique(c._get_impl()); } else { *_impl = c._get_impl(); } @@ -1353,8 +1352,7 @@ void collection::read_concern(mongocxx::v_noabi::read_concern rc) { mongocxx::v_noabi::read_concern collection::read_concern() const { auto rc = libmongoc::collection_get_read_concern(_get_impl().collection_t); - return { - bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_concern_copy(rc))}; + return {bsoncxx::make_unique(libmongoc::read_concern_copy(rc))}; } void collection::read_preference(mongocxx::v_noabi::read_preference rp) { @@ -1363,7 +1361,7 @@ void collection::read_preference(mongocxx::v_noabi::read_preference rp) { mongocxx::v_noabi::read_preference collection::read_preference() const { mongocxx::v_noabi::read_preference rp( - bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_prefs_copy( + bsoncxx::make_unique(libmongoc::read_prefs_copy( libmongoc::collection_get_read_prefs(_get_impl().collection_t)))); return rp; } @@ -1374,7 +1372,7 @@ void collection::write_concern(mongocxx::v_noabi::write_concern wc) { mongocxx::v_noabi::write_concern collection::write_concern() const { mongocxx::v_noabi::write_concern wc( - bsoncxx::v_noabi::stdx::make_unique(libmongoc::write_concern_copy( + bsoncxx::make_unique(libmongoc::write_concern_copy( libmongoc::collection_get_write_concern(_get_impl().collection_t)))); return wc; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/cursor.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/cursor.cpp index ee4195b563..50b8a01c5d 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/cursor.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/cursor.cpp @@ -13,7 +13,7 @@ // limitations under the License. #include -#include +#include #include #include @@ -27,8 +27,7 @@ namespace mongocxx { namespace v_noabi { cursor::cursor(void* cursor_ptr, bsoncxx::v_noabi::stdx::optional cursor_type) - : _impl(bsoncxx::v_noabi::stdx::make_unique(static_cast(cursor_ptr), - cursor_type)) {} + : _impl(bsoncxx::make_unique(static_cast(cursor_ptr), cursor_type)) {} cursor::cursor(cursor&&) noexcept = default; cursor& cursor::operator=(cursor&&) noexcept = default; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/database.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/database.cpp index aad77bfed4..7cbda53085 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/database.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/database.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include @@ -87,14 +87,14 @@ database::~database() = default; database::database(const mongocxx::v_noabi::client& client, bsoncxx::v_noabi::string::view_or_value name) - : _impl(bsoncxx::v_noabi::stdx::make_unique( + : _impl(bsoncxx::make_unique( libmongoc::client_get_database(client._get_impl().client_t, name.terminated().data()), &client._get_impl(), name.terminated().data())) {} database::database(const database& d) { if (d) { - _impl = bsoncxx::v_noabi::stdx::make_unique(d._get_impl()); + _impl = bsoncxx::make_unique(d._get_impl()); } } @@ -102,7 +102,7 @@ database& database::operator=(const database& d) { if (!d) { _impl.reset(); } else if (!*this) { - _impl = bsoncxx::v_noabi::stdx::make_unique(d._get_impl()); + _impl = bsoncxx::make_unique(d._get_impl()); } else { *_impl = d._get_impl(); } @@ -362,8 +362,7 @@ void database::read_concern(mongocxx::v_noabi::read_concern rc) { mongocxx::v_noabi::read_concern database::read_concern() const { auto rc = libmongoc::database_get_read_concern(_get_impl().database_t); - return { - bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_concern_copy(rc))}; + return {bsoncxx::make_unique(libmongoc::read_concern_copy(rc))}; } void database::read_preference(mongocxx::v_noabi::read_preference rp) { @@ -382,9 +381,8 @@ bool database::has_collection(bsoncxx::v_noabi::string::view_or_value name) cons } mongocxx::v_noabi::read_preference database::read_preference() const { - mongocxx::v_noabi::read_preference rp( - bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_prefs_copy( - libmongoc::database_get_read_prefs(_get_impl().database_t)))); + mongocxx::v_noabi::read_preference rp(bsoncxx::make_unique( + libmongoc::read_prefs_copy(libmongoc::database_get_read_prefs(_get_impl().database_t)))); return rp; } @@ -394,7 +392,7 @@ void database::write_concern(mongocxx::v_noabi::write_concern wc) { mongocxx::v_noabi::write_concern database::write_concern() const { mongocxx::v_noabi::write_concern wc( - bsoncxx::v_noabi::stdx::make_unique(libmongoc::write_concern_copy( + bsoncxx::make_unique(libmongoc::write_concern_copy( libmongoc::database_get_write_concern(_get_impl().database_t)))); return wc; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_failed_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_failed_event.cpp index d981676105..42972d04e5 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_failed_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_failed_event.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_started_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_started_event.cpp index b7fb0e4eb5..66fc199fbe 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_started_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_started_event.cpp @@ -13,7 +13,7 @@ // limitations under the License. #include -#include +#include #include #include diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_succeeded_event.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_succeeded_event.cpp index 5ca5070906..0d1b31c3d6 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_succeeded_event.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/command_succeeded_event.cpp @@ -13,7 +13,7 @@ // limitations under the License. #include -#include +#include #include #include diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/bucket.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/bucket.cpp index 07e3bf53b4..ae71722844 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/bucket.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/bucket.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -132,7 +132,7 @@ bucket::bucket(const database& db, const options::gridfs::bucket& options) { collection chunks = db[bucket_name + ".chunks"]; collection files = db[bucket_name + ".files"]; - _impl = bsoncxx::v_noabi::stdx::make_unique( + _impl = bsoncxx::make_unique( std::move(bucket_name), default_chunk_size_bytes, std::move(chunks), std::move(files)); if (auto read_concern = options.read_concern()) { @@ -162,7 +162,7 @@ bucket::operator bool() const noexcept { bucket::bucket(const bucket& b) { if (b) { - _impl = bsoncxx::v_noabi::stdx::make_unique(b._get_impl()); + _impl = bsoncxx::make_unique(b._get_impl()); } } @@ -170,7 +170,7 @@ bucket& bucket::operator=(const bucket& b) { if (!b) { _impl.reset(); } else if (!*this) { - _impl = bsoncxx::v_noabi::stdx::make_unique(b._get_impl()); + _impl = bsoncxx::make_unique(b._get_impl()); } else { *_impl = b._get_impl(); } @@ -255,7 +255,7 @@ void bucket::_upload_from_stream_with_id(const client_session* session, uploader upload_stream = _open_upload_stream_with_id(session, id, filename, options); std::int32_t chunk_size = upload_stream.chunk_size(); std::unique_ptr buffer = - bsoncxx::v_noabi::stdx::make_unique(static_cast(chunk_size)); + bsoncxx::make_unique(static_cast(chunk_size)); do { source->read(reinterpret_cast(buffer.get()), @@ -424,7 +424,7 @@ void bucket::_download_to_stream(const client_session* session, } auto bytes_expected = *end - *start; std::unique_ptr buffer = - bsoncxx::v_noabi::stdx::make_unique(static_cast(chunk_size)); + bsoncxx::make_unique(static_cast(chunk_size)); while (bytes_expected > 0) { const std::size_t bytes_read = download_stream.read( diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/downloader.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/downloader.cpp index f0bbc4c887..ae9c93059d 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/downloader.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/downloader.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -37,7 +37,7 @@ downloader::downloader(bsoncxx::v_noabi::stdx::optional chunks, std::int32_t chunk_size, std::int64_t file_len, bsoncxx::v_noabi::document::value files_doc) - : _impl{bsoncxx::v_noabi::stdx::make_unique( + : _impl{bsoncxx::make_unique( std::move(chunks), start, chunk_size, file_len, std::move(files_doc))} {} downloader::downloader() noexcept = default; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/uploader.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/uploader.hh index f3b4d6f5b0..aa160a6a3d 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/uploader.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/private/uploader.hh @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -38,8 +38,7 @@ class uploader::impl { std::int32_t chunk_size, bsoncxx::v_noabi::stdx::optional metadata) : session{session}, - buffer{ - bsoncxx::v_noabi::stdx::make_unique(static_cast(chunk_size))}, + buffer{bsoncxx::make_unique(static_cast(chunk_size))}, buffer_off{0}, chunks{std::move(chunks)}, chunk_size{chunk_size}, diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/uploader.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/uploader.cpp index 0abdf5040a..3cebd0ce8a 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/uploader.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/gridfs/uploader.cpp @@ -51,7 +51,7 @@ uploader::uploader( collection chunks, std::int32_t chunk_size, bsoncxx::v_noabi::stdx::optional metadata) - : _impl{bsoncxx::v_noabi::stdx::make_unique( + : _impl{bsoncxx::make_unique( session, id, filename, diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_view.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_view.cpp index 5566e873e3..11e87eab93 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_view.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/index_view.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #include #include @@ -27,8 +27,8 @@ namespace mongocxx { namespace v_noabi { index_view::index_view(void* coll, void* client) - : _impl{bsoncxx::v_noabi::stdx::make_unique(static_cast(coll), - static_cast(client))} {} + : _impl{bsoncxx::make_unique(static_cast(coll), + static_cast(client))} {} index_view::index_view(index_view&&) noexcept = default; index_view& index_view::operator=(index_view&&) noexcept = default; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/instance.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/instance.cpp index ba4abb73a6..dbbb1faeac 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/instance.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/instance.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -145,7 +145,7 @@ instance::instance(std::unique_ptr logger) { throw logic_error{error_code::k_cannot_recreate_instance}; } - _impl = bsoncxx::v_noabi::stdx::make_unique(std::move(logger)); + _impl = bsoncxx::make_unique(std::move(logger)); } instance::instance(instance&&) noexcept = default; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index.cpp index a8e93e78dd..7f1d4990f5 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/index.cpp @@ -13,7 +13,7 @@ // limitations under the License. #include -#include +#include #include #include diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/transaction.hh b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/transaction.hh index 70dd9b6fd5..4221ff25e6 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/transaction.hh +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/private/transaction.hh @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -66,8 +66,8 @@ class transaction::impl { if (!rc) { return {}; } - mongocxx::v_noabi::read_concern rci(bsoncxx::v_noabi::stdx::make_unique( - libmongoc::read_concern_copy(rc))); + mongocxx::v_noabi::read_concern rci( + bsoncxx::make_unique(libmongoc::read_concern_copy(rc))); return bsoncxx::v_noabi::stdx::optional(std::move(rci)); } @@ -82,8 +82,7 @@ class transaction::impl { return {}; } mongocxx::v_noabi::write_concern wci( - bsoncxx::v_noabi::stdx::make_unique( - libmongoc::write_concern_copy(wc))); + bsoncxx::make_unique(libmongoc::write_concern_copy(wc))); return bsoncxx::v_noabi::stdx::optional(std::move(wci)); } @@ -98,8 +97,7 @@ class transaction::impl { return {}; } mongocxx::v_noabi::read_preference rpi( - bsoncxx::v_noabi::stdx::make_unique( - libmongoc::read_prefs_copy(rp))); + bsoncxx::make_unique(libmongoc::read_prefs_copy(rp))); return bsoncxx::v_noabi::stdx::optional(std::move(rpi)); } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/transaction.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/transaction.cpp index 8ea4866bdb..b9ded7f8ff 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/transaction.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/options/transaction.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #include #include @@ -24,16 +24,16 @@ namespace mongocxx { namespace v_noabi { namespace options { -transaction::transaction() : _impl{bsoncxx::v_noabi::stdx::make_unique()} {} +transaction::transaction() : _impl{bsoncxx::make_unique()} {} transaction::transaction(transaction&&) noexcept = default; transaction& transaction::operator=(transaction&&) noexcept = default; transaction::transaction(const transaction& other) - : _impl{bsoncxx::v_noabi::stdx::make_unique(other._get_impl().get_transaction_opt_t())} {} + : _impl{bsoncxx::make_unique(other._get_impl().get_transaction_opt_t())} {} transaction& transaction::operator=(const transaction& other) { - _impl = bsoncxx::v_noabi::stdx::make_unique(other._get_impl().get_transaction_opt_t()); + _impl = bsoncxx::make_unique(other._get_impl().get_transaction_opt_t()); return *this; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pipeline.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pipeline.cpp index be855aab6d..d443f0ae10 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pipeline.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pipeline.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include @@ -27,7 +27,7 @@ using bsoncxx::v_noabi::builder::basic::sub_document; namespace mongocxx { namespace v_noabi { -pipeline::pipeline() : _impl(bsoncxx::v_noabi::stdx::make_unique()) {} +pipeline::pipeline() : _impl(bsoncxx::make_unique()) {} pipeline::pipeline(pipeline&&) noexcept = default; pipeline& pipeline::operator=(pipeline&&) noexcept = default; diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pool.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pool.cpp index 99ddc8fbc4..a89e60c72a 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pool.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/pool.cpp @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -56,7 +56,7 @@ void pool::_release(client* client) { pool::~pool() = default; pool::pool(const uri& uri, const options::pool& options) - : _impl{bsoncxx::v_noabi::stdx::make_unique(construct_client_pool(uri._impl->uri_t))} { + : _impl{bsoncxx::make_unique(construct_client_pool(uri._impl->uri_t))} { #if defined(MONGOCXX_ENABLE_SSL) && defined(MONGOC_ENABLE_SSL) if (options.client_opts().tls_opts()) { if (!uri.tls()) diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_concern.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_concern.cpp index 900bc21d27..ab61c03e4a 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_concern.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_concern.cpp @@ -13,7 +13,7 @@ // limitations under the License. #include -#include +#include #include #include @@ -27,8 +27,7 @@ namespace mongocxx { namespace v_noabi { -read_concern::read_concern() - : _impl{bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_concern_new())} {} +read_concern::read_concern() : _impl{bsoncxx::make_unique(libmongoc::read_concern_new())} {} read_concern::read_concern(std::unique_ptr&& implementation) : _impl{std::move(implementation)} {} @@ -37,12 +36,11 @@ read_concern::read_concern(read_concern&&) noexcept = default; read_concern& read_concern::operator=(read_concern&&) noexcept = default; read_concern::read_concern(const read_concern& other) - : _impl(bsoncxx::v_noabi::stdx::make_unique( - libmongoc::read_concern_copy(other._impl->read_concern_t))) {} + : _impl(bsoncxx::make_unique(libmongoc::read_concern_copy(other._impl->read_concern_t))) { +} read_concern& read_concern::operator=(const read_concern& other) { - _impl = bsoncxx::v_noabi::stdx::make_unique( - libmongoc::read_concern_copy(other._impl->read_concern_t)); + _impl = bsoncxx::make_unique(libmongoc::read_concern_copy(other._impl->read_concern_t)); return *this; } diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_preference.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_preference.cpp index f415b79229..d5f1313daa 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_preference.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/read_preference.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #include #include @@ -32,13 +32,13 @@ read_preference::read_preference(read_preference&&) noexcept = default; read_preference& read_preference::operator=(read_preference&&) noexcept = default; read_preference::read_preference(const read_preference& other) - : _impl(bsoncxx::v_noabi::stdx::make_unique( - libmongoc::read_prefs_copy(other._impl->read_preference_t))) {} + : _impl( + bsoncxx::make_unique(libmongoc::read_prefs_copy(other._impl->read_preference_t))) {} read_preference& read_preference::operator=(const read_preference& other) { - _impl.reset(bsoncxx::v_noabi::stdx::make_unique( - libmongoc::read_prefs_copy(other._impl->read_preference_t)) - .release()); + _impl.reset( + bsoncxx::make_unique(libmongoc::read_prefs_copy(other._impl->read_preference_t)) + .release()); return *this; } @@ -47,13 +47,13 @@ read_preference::read_preference(std::unique_ptr&& implementation) { } read_preference::read_preference() - : _impl(bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_prefs_new( + : _impl(bsoncxx::make_unique(libmongoc::read_prefs_new( libmongoc::conversions::read_mode_t_from_read_mode(read_mode::k_primary)))) {} read_preference::read_preference(read_mode mode) : read_preference(mode, deprecated_tag{}) {} read_preference::read_preference(read_mode mode, deprecated_tag) - : _impl(bsoncxx::v_noabi::stdx::make_unique( + : _impl(bsoncxx::make_unique( libmongoc::read_prefs_new(libmongoc::conversions::read_mode_t_from_read_mode(mode)))) {} read_preference::read_preference(read_mode mode, bsoncxx::v_noabi::document::view_or_value tags) diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_model.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_model.cpp index fa00cfd51a..18f21ed435 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_model.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_model.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -11,17 +11,17 @@ namespace mongocxx { namespace v_noabi { search_index_model::search_index_model(bsoncxx::v_noabi::document::view_or_value definition) - : _impl{bsoncxx::v_noabi::stdx::make_unique(definition)} {} + : _impl{bsoncxx::make_unique(definition)} {} search_index_model::search_index_model(bsoncxx::v_noabi::string::view_or_value name, bsoncxx::v_noabi::document::view_or_value definition) - : _impl{bsoncxx::v_noabi::stdx::make_unique(name, definition)} {} + : _impl{bsoncxx::make_unique(name, definition)} {} search_index_model::search_index_model(search_index_model&&) noexcept = default; search_index_model& search_index_model::operator=(search_index_model&&) noexcept = default; search_index_model::search_index_model(const search_index_model& other) - : _impl(bsoncxx::v_noabi::stdx::make_unique(other._get_impl())) {} + : _impl(bsoncxx::make_unique(other._get_impl())) {} search_index_model& search_index_model::operator=(const search_index_model& other) { _get_impl() = other._get_impl(); diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_view.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_view.cpp index ddcbf76b7a..5bbaaf32c0 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_view.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/search_index_view.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -11,14 +11,14 @@ namespace mongocxx { namespace v_noabi { search_index_view::search_index_view(void* coll, void* client) - : _impl{bsoncxx::v_noabi::stdx::make_unique(static_cast(coll), - static_cast(client))} {} + : _impl{bsoncxx::make_unique(static_cast(coll), + static_cast(client))} {} search_index_view::search_index_view(search_index_view&&) noexcept = default; search_index_view& search_index_view::operator=(search_index_view&&) noexcept = default; search_index_view::search_index_view(const search_index_view& other) - : _impl(bsoncxx::v_noabi::stdx::make_unique(other._get_impl())) {} + : _impl(bsoncxx::make_unique(other._get_impl())) {} search_index_view& search_index_view::operator=(const search_index_view& other) { _get_impl() = other._get_impl(); diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/uri.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/uri.cpp index 7c52352fc9..8cc6a2ac17 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/uri.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/uri.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #include #include @@ -51,7 +51,7 @@ uri::uri(std::unique_ptr&& implementation) { uri::uri(bsoncxx::v_noabi::string::view_or_value uri_string) { bson_error_t error; - _impl = bsoncxx::v_noabi::stdx::make_unique( + _impl = bsoncxx::make_unique( libmongoc::uri_new_with_error(uri_string.terminated().data(), &error)); if (_impl->uri_t == nullptr) { @@ -99,13 +99,13 @@ std::string uri::password() const { mongocxx::v_noabi::read_concern uri::read_concern() const { auto rc = libmongoc::uri_get_read_concern(_impl->uri_t); return mongocxx::v_noabi::read_concern( - bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_concern_copy(rc))); + bsoncxx::make_unique(libmongoc::read_concern_copy(rc))); } mongocxx::v_noabi::read_preference uri::read_preference() const { auto rp = libmongoc::uri_get_read_prefs_t(_impl->uri_t); return mongocxx::v_noabi::read_preference( - bsoncxx::v_noabi::stdx::make_unique(libmongoc::read_prefs_copy(rp))); + bsoncxx::make_unique(libmongoc::read_prefs_copy(rp))); } std::string uri::replica_set() const { @@ -131,8 +131,7 @@ std::string uri::username() const { mongocxx::v_noabi::write_concern uri::write_concern() const { auto wc = libmongoc::uri_get_write_concern(_impl->uri_t); return mongocxx::v_noabi::write_concern( - bsoncxx::v_noabi::stdx::make_unique( - libmongoc::write_concern_copy(wc))); + bsoncxx::make_unique(libmongoc::write_concern_copy(wc))); } static bsoncxx::v_noabi::stdx::optional _string_option( diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/write_concern.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/write_concern.cpp index 4256b8fdf6..03129d7b61 100644 --- a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/write_concern.cpp +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/write_concern.cpp @@ -13,7 +13,7 @@ // limitations under the License. #include -#include +#include #include #include @@ -29,7 +29,7 @@ namespace mongocxx { namespace v_noabi { write_concern::write_concern() - : _impl{bsoncxx::v_noabi::stdx::make_unique(libmongoc::write_concern_new())} {} + : _impl{bsoncxx::make_unique(libmongoc::write_concern_new())} {} write_concern::write_concern(std::unique_ptr&& implementation) { _impl.reset(implementation.release()); @@ -39,13 +39,14 @@ write_concern::write_concern(write_concern&&) noexcept = default; write_concern& write_concern::operator=(write_concern&&) noexcept = default; write_concern::write_concern(const write_concern& other) - : _impl(bsoncxx::v_noabi::stdx::make_unique( - libmongoc::write_concern_copy(other._impl->write_concern_t))) {} + : _impl( + bsoncxx::make_unique(libmongoc::write_concern_copy(other._impl->write_concern_t))) { +} write_concern& write_concern::operator=(const write_concern& other) { - _impl.reset(bsoncxx::v_noabi::stdx::make_unique( - libmongoc::write_concern_copy(other._impl->write_concern_t)) - .release()); + _impl.reset( + bsoncxx::make_unique(libmongoc::write_concern_copy(other._impl->write_concern_t)) + .release()); return *this; } diff --git a/src/mongocxx/test/client_session.cpp b/src/mongocxx/test/client_session.cpp index 6350b95279..76ecbcc332 100644 --- a/src/mongocxx/test/client_session.cpp +++ b/src/mongocxx/test/client_session.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include @@ -215,8 +215,8 @@ TEST_CASE("session", "[session]") { SECTION("pool") { // "Pool is LIFO" test from Driver Sessions Spec. - auto session_a = bsoncxx::stdx::make_unique(c.start_session()); - auto session_b = bsoncxx::stdx::make_unique(c.start_session()); + auto session_a = bsoncxx::make_unique(c.start_session()); + auto session_b = bsoncxx::make_unique(c.start_session()); auto a_id = value(session_a->id()); auto b_id = value(session_b->id()); @@ -227,9 +227,9 @@ TEST_CASE("session", "[session]") { session_a = nullptr; session_b = nullptr; - auto session_c = bsoncxx::stdx::make_unique(c.start_session()); + auto session_c = bsoncxx::make_unique(c.start_session()); REQUIRE(session_c->id() == b_id); - auto session_d = bsoncxx::stdx::make_unique(c.start_session()); + auto session_d = bsoncxx::make_unique(c.start_session()); REQUIRE(session_d->id() == a_id); } diff --git a/src/mongocxx/test/client_side_encryption.cpp b/src/mongocxx/test/client_side_encryption.cpp index 7fb75f8ddf..5ea2595712 100644 --- a/src/mongocxx/test/client_side_encryption.cpp +++ b/src/mongocxx/test/client_side_encryption.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -3023,10 +3023,8 @@ range_explicit_encryption_objects range_explicit_encryption_setup(const std::str const auto kms_providers = _make_kms_doc(false); - using bsoncxx::stdx::make_unique; - // Create a MongoClient named `keyVaultClient`. - auto& key_vault_client = *(res.key_vault_client_ptr = make_unique( + auto& key_vault_client = *(res.key_vault_client_ptr = bsoncxx::make_unique( uri(), test_util::add_test_server_api())); // Create a ClientEncryption object named `clientEncryption` with these options: @@ -3036,7 +3034,7 @@ range_explicit_encryption_objects range_explicit_encryption_setup(const std::str // kmsProviders: { "local": { "key": } } // } auto& client_encryption = - *(res.client_encryption_ptr = make_unique( + *(res.client_encryption_ptr = bsoncxx::make_unique( options::client_encryption() .key_vault_client(&key_vault_client) .key_vault_namespace({"keyvault", "datakeys"}) @@ -3048,7 +3046,7 @@ range_explicit_encryption_objects range_explicit_encryption_setup(const std::str // kmsProviders: { "local": { "key": } } // bypassQueryAnalysis: true // } - auto& encrypted_client = *(res.encrypted_client_ptr = make_unique( + auto& encrypted_client = *(res.encrypted_client_ptr = bsoncxx::make_unique( uri(), test_util::add_test_server_api().auto_encryption_opts( options::auto_encryption() @@ -3057,7 +3055,8 @@ range_explicit_encryption_objects range_explicit_encryption_setup(const std::str .bypass_query_analysis(true)))); // Ensure the type matches with the type of the encrypted field. - const auto& field_values = *(res.field_values_ptr = make_unique(field_type)); + const auto& field_values = + *(res.field_values_ptr = bsoncxx::make_unique(field_type)); const auto& field_name = (res.field_name = "encrypted" + type_str); const auto& range_opts = (res.range_opts = to_range_opts(field_type)); diff --git a/src/mongocxx/test/collection.cpp b/src/mongocxx/test/collection.cpp index 4d8adf5204..1a4f5d19ad 100644 --- a/src/mongocxx/test/collection.cpp +++ b/src/mongocxx/test/collection.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include @@ -2313,7 +2313,7 @@ TEST_CASE("create_index tests", "[collection]") { options.name(index_name); std::unique_ptr wt_options = - bsoncxx::stdx::make_unique(); + bsoncxx::make_unique(); wt_options->config_string("block_allocation=first"); REQUIRE_NOTHROW(options.storage_options(std::move(wt_options))); diff --git a/src/mongocxx/test/logging.cpp b/src/mongocxx/test/logging.cpp index 704677a9b9..953c5039a9 100644 --- a/src/mongocxx/test/logging.cpp +++ b/src/mongocxx/test/logging.cpp @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -53,7 +53,7 @@ TEST_CASE("a user-provided log handler will be used for logging output", "[insta reset_log_handler_when_done rlhwd; std::vector events; - mongocxx::instance driver{bsoncxx::stdx::make_unique(&events)}; + mongocxx::instance driver{bsoncxx::make_unique(&events)}; REQUIRE(&mongocxx::instance::current() == &driver); diff --git a/src/mongocxx/test/options/index.cpp b/src/mongocxx/test/options/index.cpp index 3c3a573565..47b2a739b5 100644 --- a/src/mongocxx/test/options/index.cpp +++ b/src/mongocxx/test/options/index.cpp @@ -13,7 +13,7 @@ // limitations under the License. #include -#include +#include #include #include @@ -35,7 +35,7 @@ TEST_CASE("index", "[index][option]") { options::index idx; std::unique_ptr storage = - bsoncxx::stdx::make_unique(); + bsoncxx::make_unique(); auto collation = make_document(kvp("locale", "en_US")); auto partial_filter_expression = make_document(kvp("x", true)); diff --git a/src/mongocxx/test/spec/gridfs.cpp b/src/mongocxx/test/spec/gridfs.cpp index 2d09805fa1..dd272b74d4 100644 --- a/src/mongocxx/test/spec/gridfs.cpp +++ b/src/mongocxx/test/spec/gridfs.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -215,7 +215,7 @@ void test_download(database db, std::unique_ptr actual(nullptr); if (length > 0) { - actual = bsoncxx::stdx::make_unique(static_cast(length)); + actual = bsoncxx::make_unique(static_cast(length)); } if (assert_doc["error"]) {