diff --git a/Doxyfile b/Doxyfile index 3a3d9ce66d..e62228d93d 100644 --- a/Doxyfile +++ b/Doxyfile @@ -901,8 +901,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/operators.hpp \ - src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/type_traits.hpp +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -938,7 +937,7 @@ EXCLUDE_SYMBOLS = bsoncxx::detail \ # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = . +EXAMPLE_PATH = examples # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and diff --git a/examples/bsoncxx/CMakeLists.txt b/examples/bsoncxx/CMakeLists.txt index 222367af3b..e440953b99 100644 --- a/examples/bsoncxx/CMakeLists.txt +++ b/examples/bsoncxx/CMakeLists.txt @@ -12,10 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -include_directories( - ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/bsoncxx/v_noabi -) - set(BSONCXX_EXAMPLES builder_core.cpp builder_list.cpp diff --git a/examples/mongocxx/CMakeLists.txt b/examples/mongocxx/CMakeLists.txt index 53664eba96..292f150f58 100644 --- a/examples/mongocxx/CMakeLists.txt +++ b/examples/mongocxx/CMakeLists.txt @@ -12,11 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -include_directories( - ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/bsoncxx/v_noabi - ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/mongocxx/v_noabi -) - set(MONGOCXX_EXAMPLES aggregate.cpp automatic_client_side_field_level_encryption.cpp diff --git a/examples/mongocxx/connect.cpp b/examples/mongocxx/connect.cpp index 137584ac78..35f865cbe2 100644 --- a/examples/mongocxx/connect.cpp +++ b/examples/mongocxx/connect.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -44,6 +43,11 @@ class logger final : public mongocxx::logger { std::ostream* const _stream; }; +// Use `std::make_unique` with C++14 and newer. +std::unique_ptr make_logger() { + return std::unique_ptr(new logger(&std::cout)); +} + } // namespace int main(int argc, char* argv[]) { @@ -53,7 +57,7 @@ int main(int argc, char* argv[]) { // The mongocxx::instance constructor and destructor initialize and shut down the driver, // respectively. Therefore, a mongocxx::instance must be created before using the driver and // must remain alive for as long as the driver is in use. - mongocxx::instance inst{bsoncxx::stdx::make_unique(&std::cout)}; + mongocxx::instance inst{make_logger()}; try { const auto uri = mongocxx::uri{(argc >= 2) ? argv[1] : mongocxx::uri::k_default_uri}; diff --git a/examples/mongocxx/gridfs.cpp b/examples/mongocxx/gridfs.cpp index 86ea44becb..2dc148a985 100644 --- a/examples/mongocxx/gridfs.cpp +++ b/examples/mongocxx/gridfs.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -25,8 +24,6 @@ using namespace mongocxx; -using bsoncxx::stdx::make_unique; - int main() { // The mongocxx::instance constructor and destructor initialize and shut down the driver, // respectively. Therefore, a mongocxx::instance must be created before using the driver and @@ -61,7 +58,9 @@ int main() { auto bytes_counter = 0; auto buffer_size = std::min(file_length, static_cast(downloader.chunk_size())); - auto buffer = make_unique(static_cast(buffer_size)); + + // Use `std::make_unique` with C++14 and newer. + auto buffer = std::unique_ptr(new std::uint8_t[buffer_size]); while (auto length_read = downloader.read(buffer.get(), static_cast(buffer_size))) { diff --git a/examples/mongocxx/index.cpp b/examples/mongocxx/index.cpp index 4c6965b2b5..ff33bb423a 100644 --- a/examples/mongocxx/index.cpp +++ b/examples/mongocxx/index.cpp @@ -14,7 +14,6 @@ #include #include -#include #include #include #include @@ -58,8 +57,11 @@ int main(int, char**) { { db["restaurants"].drop(); mongocxx::options::index index_options{}; - std::unique_ptr wt_options = - bsoncxx::stdx::make_unique(); + + // Use `std::make_unique` with C++14 and newer. + std::unique_ptr wt_options{ + new mongocxx::options::index::wiredtiger_storage_options()}; + wt_options->config_string("block_allocation=first"); index_options.storage_options(std::move(wt_options)); db["restaurants"].create_index(make_document(kvp("cuisine", 1)), index_options); diff --git a/examples/mongocxx/instance_management.cpp b/examples/mongocxx/instance_management.cpp index 5c02b74947..8265494580 100644 --- a/examples/mongocxx/instance_management.cpp +++ b/examples/mongocxx/instance_management.cpp @@ -14,8 +14,8 @@ #include #include +#include -#include #include #include #include @@ -80,11 +80,14 @@ void configure(mongocxx::uri uri) { bsoncxx::stdx::string_view) noexcept {} }; - auto instance = - bsoncxx::stdx::make_unique(bsoncxx::stdx::make_unique()); + // Use `std::make_unique` with C++14 and newer. + auto instance = std::unique_ptr( + new mongocxx::instance(std::unique_ptr(new noop_logger()))); - mongo_access::instance().configure(std::move(instance), - bsoncxx::stdx::make_unique(std::move(uri))); + // Use `std::make_unique` with C++14 and newer. + auto pool = std::unique_ptr(new mongocxx::pool(std::move(uri))); + + mongo_access::instance().configure(std::move(instance), std::move(pool)); } bool do_work() { diff --git a/examples/mongocxx/view_or_value_variant.cpp b/examples/mongocxx/view_or_value_variant.cpp index c0032c9055..2836bcaf45 100644 --- a/examples/mongocxx/view_or_value_variant.cpp +++ b/examples/mongocxx/view_or_value_variant.cpp @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/element-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/element-fwd.hpp index 1c3504cc99..489fafcf51 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/element-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/element-fwd.hpp @@ -35,3 +35,21 @@ using ::bsoncxx::v_noabi::array::element; } // namespace bsoncxx #include + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::array::element. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace array { + +/// @ref bsoncxx::v_noabi::array::element +class element {}; + +} // namespace array +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/element.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/element.hpp index 8a95f424bd..4f7ef2cfec 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/element.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/element.hpp @@ -124,3 +124,30 @@ using ::bsoncxx::v_noabi::array::operator!=; } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::array::element. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace array { + +/// @ref bsoncxx::v_noabi::array::operator==(const v_noabi::array::element& elem, const v_noabi::types::bson_value::view& v) +bool operator==(const v_noabi::array::element& elem, const v_noabi::types::bson_value::view& v); + +/// @ref bsoncxx::v_noabi::array::operator==(const v_noabi::types::bson_value::view& v, const v_noabi::array::element& elem) +bool operator==(const v_noabi::types::bson_value::view& v, const v_noabi::array::element& elem); + +/// @ref bsoncxx::v_noabi::array::operator!=(const v_noabi::array::element& elem, const v_noabi::types::bson_value::view& v) +bool operator!=(const v_noabi::array::element& elem, const v_noabi::types::bson_value::view& v); + +/// @ref bsoncxx::v_noabi::array::operator!=(const v_noabi::types::bson_value::view& v, const v_noabi::array::element& elem) +bool operator!=(const v_noabi::types::bson_value::view& v, const v_noabi::array::element& elem); + +} // namespace array +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/value-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/value-fwd.hpp index 8f6e249bc0..6b2d0ad85e 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/value-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/value-fwd.hpp @@ -35,3 +35,21 @@ using ::bsoncxx::v_noabi::array::value; } // namespace bsoncxx #include + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::array::value. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace array { + +/// @ref bsoncxx::v_noabi::array::value +class value {}; + +} // namespace array +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/value.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/value.hpp index 41e0685175..2e39555faf 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/value.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/value.hpp @@ -120,3 +120,8 @@ BSONCXX_INLINE value::operator array::view() const noexcept { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::array::value. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view-fwd.hpp index cd5f02b59f..a55588618b 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view-fwd.hpp @@ -35,3 +35,21 @@ using ::bsoncxx::v_noabi::array::view; } // namespace bsoncxx #include + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::array::view. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace array { + +/// @ref bsoncxx::v_noabi::array::view +class view {}; + +} // namespace array +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view.hpp index 12a001b05c..d65265a34e 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view.hpp @@ -190,3 +190,8 @@ class view::const_iterator { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::array::view. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view_or_value.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view_or_value.hpp index 85457a00bd..6cdd2114ae 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view_or_value.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view_or_value.hpp @@ -43,3 +43,21 @@ using ::bsoncxx::v_noabi::array::view_or_value; } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::array::view_or_value. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace array { + +/// @ref bsoncxx::v_noabi::array::view_or_value +class view_or_value {}; + +} // namespace array +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/array-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/array-fwd.hpp index 91c3a8d9fa..4123f7182d 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/array-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/array-fwd.hpp @@ -35,3 +35,23 @@ using ::bsoncxx::v_noabi::builder::basic::array; } // namespace basic } // namespace builder } // namespace bsoncxx + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::builder::basic::array. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace basic { + +/// @ref bsoncxx::v_noabi::builder::basic::array +class array {}; + +} // namespace basic +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/array.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/array.hpp index 6fa924a7b3..003690993f 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/array.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/array.hpp @@ -136,3 +136,24 @@ using ::bsoncxx::v_noabi::builder::basic::make_array; } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::builder::basic::array. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace basic { + +/// @ref bsoncxx::v_noabi::builder::basic::make_array +template +v_noabi::array::value make_array(Args&&... args); + +} // namespace basic +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/document-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/document-fwd.hpp index 5cbab1db20..03a831e58c 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/document-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/document-fwd.hpp @@ -35,3 +35,23 @@ using ::bsoncxx::v_noabi::builder::basic::document; } // namespace basic } // namespace builder } // namespace bsoncxx + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::builder::basic::document. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace basic { + +/// @ref bsoncxx::v_noabi::builder::basic::document +class document {}; + +} // namespace basic +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/document.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/document.hpp index 2dc23d1658..6b40d85e6f 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/document.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/document.hpp @@ -135,3 +135,24 @@ using ::bsoncxx::v_noabi::builder::basic::make_document; } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::builder::basic::document. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace basic { + +/// @ref bsoncxx::v_noabi::builder::basic::make_document +template +v_noabi::document::value make_document(Args&&... args); + +} // namespace basic +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/helpers.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/helpers.hpp index 49c74541da..32d930d003 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/helpers.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/helpers.hpp @@ -41,3 +41,26 @@ using ::bsoncxx::v_noabi::builder::basic::concatenate; } // namespace bsoncxx #include + +/// +/// @file +/// Redeclares @ref bsoncxx::v_noabi::builder::concatenate in the @ref +/// bsoncxx::v_noabi::builder::basic namespace. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace basic { + +/// @ref bsoncxx::v_noabi::builder::concatenate(v_noabi::document::view_or_value doc) +/// @note An overload accepting @ref v_noabi::array::view_or_value and returning a @ref +/// v_noabi::builder::concatenate_array is also declared in this scope. +v_noabi::concatenate_doc concatenate(v_noabi::document::view_or_value doc); + +} // namespace basic +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/impl.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/impl.hpp index 1373a9353d..d5195d2bca 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/impl.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/impl.hpp @@ -62,3 +62,8 @@ BSONCXX_INLINE void value_append(core* core, T&& t) { } // namespace bsoncxx #include + +/// +/// @file +/// For internal use only! +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/kvp.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/kvp.hpp index 3b508c8879..c7c363c02f 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/kvp.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/kvp.hpp @@ -48,3 +48,24 @@ using ::bsoncxx::v_noabi::builder::basic::kvp; } // namespace bsoncxx #include + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::builder::basic::kvp. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace basic { + +/// @ref bsoncxx::v_noabi::builder::basic::kvp +template +std::tuple kvp(T&& t, U&& u); + +} // namespace basic +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_array-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_array-fwd.hpp index d3c85f46f0..1833bd84ed 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_array-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_array-fwd.hpp @@ -35,3 +35,23 @@ using ::bsoncxx::v_noabi::builder::basic::sub_array; } // namespace basic } // namespace builder } // namespace bsoncxx + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::builder::basic::sub_array. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace basic { + +/// @ref bsoncxx::v_noabi::builder::basic::sub_array +class sub_array {}; + +} // namespace basic +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_array.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_array.hpp index 489a890787..5e9fd0ceee 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_array.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_array.hpp @@ -86,3 +86,8 @@ class sub_array { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::builder::basic::sub_array. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_document-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_document-fwd.hpp index 9a8591a1a4..9017435129 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_document-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_document-fwd.hpp @@ -35,3 +35,23 @@ using ::bsoncxx::v_noabi::builder::basic::sub_document; } // namespace basic } // namespace builder } // namespace bsoncxx + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::builder::basic::sub_document. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace basic { + +/// @ref bsoncxx::v_noabi::builder::basic::sub_document +class sub_document {}; + +} // namespace basic +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_document.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_document.hpp index 82c7163d5a..694614d5ec 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_document.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_document.hpp @@ -106,3 +106,8 @@ class sub_document { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::builder::basic::sub_document. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate-fwd.hpp index 0ef820314d..d90d184d4f 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate-fwd.hpp @@ -33,3 +33,24 @@ using ::bsoncxx::v_noabi::builder::concatenate_doc; } // namespace builder } // namespace bsoncxx + +/// +/// @file +/// Provides concatenators for use with "streaming" BSON builder syntax. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { + +/// @ref bsoncxx::v_noabi::builder::concatenate_doc +struct concatenate_doc {}; + +/// @ref bsoncxx::v_noabi::builder::concatenate_array +struct concatenate_array {}; + +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate.hpp index ab7e17c2ea..41ce8fd35d 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate.hpp @@ -94,7 +94,7 @@ struct concatenate_array { /// @see bsoncxx::v_noabi::builder::concatenate_doc /// /// @note An overload accepting @ref v_noabi::array::view_or_value and returning a @ref -/// concatenate_array is also declared in this scope. +/// v_noabi::builder::concatenate_array is also declared in this scope. /// BSONCXX_INLINE concatenate_doc concatenate(document::view_or_value doc) { return {std::move(doc)}; @@ -120,3 +120,23 @@ using ::bsoncxx::v_noabi::builder::concatenate; } // namespace bsoncxx #include + +/// +/// @file +/// Provides concatenators for use with "streaming" BSON builder syntax. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { + +/// @ref bsoncxx::v_noabi::builder::concatenate +/// @note An overload accepting @ref v_noabi::array::view_or_value and returning a @ref +/// v_noabi::builder::concatenate_array is also declared in this scope. +v_noabi::builder::concatenate_doc concatenate(v_noabi::document::view_or_value doc); + +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/core-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/core-fwd.hpp index 77037c1b00..0880900c95 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/core-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/core-fwd.hpp @@ -35,3 +35,21 @@ using ::bsoncxx::v_noabi::builder::core; } // namespace bsoncxx #include + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::builder::core. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { + +/// @ref bsoncxx::v_noabi::builder::core +class core {}; + +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/core.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/core.hpp index 8c103e307e..13ad1bc1b7 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/core.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/core.hpp @@ -702,3 +702,8 @@ class core { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::builder::core. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/list-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/list-fwd.hpp index 1fb690653c..bc8d33ae4a 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/list-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/list-fwd.hpp @@ -35,3 +35,27 @@ using ::bsoncxx::v_noabi::builder::list; } // namespace builder } // namespace bsoncxx + +/// +/// @file +/// Provides entities for use with "list" BSON builder syntax. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { + +/// @ref bsoncxx::v_noabi::builder::array +class array {}; + +/// @ref bsoncxx::v_noabi::builder::document +class document {}; + +/// @ref bsoncxx::v_noabi::builder::list +class list {}; + +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/list.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/list.hpp index 09376492e2..c2c9e6c676 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/list.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/list.hpp @@ -30,7 +30,7 @@ namespace bsoncxx { namespace v_noabi { namespace builder { -using namespace ::bsoncxx::v_noabi::types; // Deprecated. +using namespace ::bsoncxx::v_noabi::types; // Deprecated. Deliberately undocumented. } // namespace builder } // namespace v_noabi @@ -204,7 +204,7 @@ class array : public list { namespace bsoncxx { namespace builder { -using namespace ::bsoncxx::v_noabi::types; // Deprecated. +using namespace ::bsoncxx::v_noabi::types; // Deprecated. Deliberately undocumented. } // namespace builder } // namespace bsoncxx @@ -213,3 +213,8 @@ using namespace ::bsoncxx::v_noabi::types; // Deprecated. #if defined(BSONCXX_TEST_MACRO_GUARDS_FIX_MISSING_POSTLUDE) #include #endif + +/// +/// @file +/// Provides entities for use with "list" BSON builder syntax. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array-fwd.hpp index 775fe0f99e..99907d6700 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array-fwd.hpp @@ -35,3 +35,23 @@ using ::bsoncxx::v_noabi::builder::stream::array; } // namespace stream } // namespace builder } // namespace bsoncxx + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::builder::stream::array. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace stream { + +/// @ref bsoncxx::v_noabi::builder::stream::array +class array {}; + +} // namespace stream +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array.hpp index b2dcffa8fa..645798b052 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array.hpp @@ -90,3 +90,8 @@ class array : public array_context<> { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::builder::stream::array. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array_context-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array_context-fwd.hpp index f9c4d33900..fa9e217dff 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array_context-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array_context-fwd.hpp @@ -38,3 +38,23 @@ using ::bsoncxx::v_noabi::builder::stream::array_context; } // namespace stream } // namespace builder } // namespace bsoncxx + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::builder::stream::array_context. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace stream { + +/// @ref bsoncxx::v_noabi::builder::stream::array_context +class array_context {}; + +} // namespace stream +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array_context.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array_context.hpp index 25be67c638..5ddd380d93 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array_context.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array_context.hpp @@ -193,3 +193,8 @@ class array_context { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::builder::stream::array_context. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/closed_context-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/closed_context-fwd.hpp index be8fe31196..ed2cd8ca10 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/closed_context-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/closed_context-fwd.hpp @@ -35,3 +35,23 @@ using ::bsoncxx::v_noabi::builder::stream::closed_context; } // namespace stream } // namespace builder } // namespace bsoncxx + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::builder::stream::closed_context. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace stream { + +/// @ref bsoncxx::v_noabi::builder::stream::closed_context +class closed_context {}; + +} // namespace stream +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/closed_context.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/closed_context.hpp index f6a46a119f..59e737b352 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/closed_context.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/closed_context.hpp @@ -41,3 +41,8 @@ struct closed_context { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::builder::stream::closed_context. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/document-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/document-fwd.hpp index ce2a56a136..26692f3eb1 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/document-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/document-fwd.hpp @@ -35,3 +35,23 @@ using ::bsoncxx::v_noabi::builder::stream::document; } // namespace stream } // namespace builder } // namespace bsoncxx + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::builder::stream::document. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace stream { + +/// @ref bsoncxx::v_noabi::builder::stream::document +class document {}; + +} // namespace stream +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/document.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/document.hpp index d55f4daa5f..65bb14c49e 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/document.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/document.hpp @@ -88,3 +88,8 @@ class document : public key_context<> { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::builder::stream::document. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/helpers-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/helpers-fwd.hpp index 15fae54b0f..007f029dc8 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/helpers-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/helpers-fwd.hpp @@ -33,3 +33,9 @@ struct BSONCXX_API finalize_type; } // namespace bsoncxx #include + +/// +/// @file +/// Provides types used to define stream manipulators in @ref +/// bsoncxx/v_noabi/bsoncxx/builder/stream/helpers.hpp. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/helpers.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/helpers.hpp index 0e222c53d5..8945eb8fe6 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/helpers.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/helpers.hpp @@ -24,7 +24,7 @@ namespace v_noabi { namespace builder { namespace stream { -using ::bsoncxx::v_noabi::builder::concatenate; // Deprecated. +using ::bsoncxx::v_noabi::builder::concatenate; // Deprecated. Deliberately undocumented. /// /// The type of a stream manipulator to open a subdocument. @@ -100,7 +100,7 @@ namespace bsoncxx { namespace builder { namespace stream { -using ::bsoncxx::v_noabi::builder::stream::concatenate; // Deprecated. +using ::bsoncxx::v_noabi::builder::stream::concatenate; // Deprecated. Deliberately undocumented. using ::bsoncxx::v_noabi::builder::stream::close_array; using ::bsoncxx::v_noabi::builder::stream::close_document; @@ -113,3 +113,35 @@ using ::bsoncxx::v_noabi::builder::stream::open_document; } // namespace bsoncxx #include + +/// +/// @file +/// Provides stream manipulators for use with "streaming" BSON builder syntax. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace stream { + +/// @ref bsoncxx::v_noabi::builder::stream::close_array +constexpr close_array_type close_array; + +/// @ref bsoncxx::v_noabi::builder::stream::close_document +constexpr close_document_type close_document; + +/// @ref bsoncxx::v_noabi::builder::stream::finalize +constexpr finalize_type finalize; + +/// @ref bsoncxx::v_noabi::builder::stream::open_array +constexpr open_array_type open_array; + +/// @ref bsoncxx::v_noabi::builder::stream::open_document +constexpr open_document_type open_document; + +} // namespace stream +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/key_context-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/key_context-fwd.hpp index 9705ec2bad..266c8e4770 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/key_context-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/key_context-fwd.hpp @@ -38,3 +38,23 @@ using ::bsoncxx::v_noabi::builder::stream::key_context; } // namespace stream } // namespace builder } // namespace bsoncxx + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::builder::stream::key_context. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace stream { + +/// @ref bsoncxx::v_noabi::builder::stream::key_context +class key_context {}; + +} // namespace stream +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/key_context.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/key_context.hpp index fb7b404870..80a438c6e2 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/key_context.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/key_context.hpp @@ -183,3 +183,8 @@ class key_context { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::builder::stream::key_context. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/single_context-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/single_context-fwd.hpp index cc9f52b772..1c8a06fce2 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/single_context-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/single_context-fwd.hpp @@ -37,3 +37,23 @@ using ::bsoncxx::v_noabi::builder::stream::single_context; } // namespace stream } // namespace builder } // namespace bsoncxx + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::builder::stream::single_context. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace stream { + +/// @ref bsoncxx::v_noabi::builder::stream::single_context +class single_context {}; + +} // namespace stream +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/single_context.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/single_context.hpp index 618121761b..8ffe155be8 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/single_context.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/single_context.hpp @@ -113,3 +113,8 @@ BSONCXX_INLINE value_context::operator single_context() { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::builder::stream::single_context. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/value_context-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/value_context-fwd.hpp index 6d6575f6c4..0f72cc105f 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/value_context-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/value_context-fwd.hpp @@ -40,3 +40,23 @@ using ::bsoncxx::v_noabi::builder::stream::value_context; } // namespace bsoncxx #include + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::builder::stream::value_context. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace builder { +namespace stream { + +/// @ref bsoncxx::v_noabi::builder::stream::value_context +class value_context {}; + +} // namespace stream +} // namespace builder +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/value_context.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/value_context.hpp index db293b3dcc..6f5e871fc6 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/value_context.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/value_context.hpp @@ -141,3 +141,8 @@ class value_context { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::builder::stream::value_context. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/util.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/util.hpp index c12caac094..239dc09405 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/util.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/util.hpp @@ -1,34 +1,24 @@ -// clang-format off -/** - * @internal - * @brief Convert the given macro argument to a string literal, after macro expansion - */ +// Convert the given macro argument to a string literal, after macro expansion. #define BSONCXX_STRINGIFY(...) BSONCXX_STRINGIFY_IMPL(__VA_ARGS__) #define BSONCXX_STRINGIFY_IMPL(...) #__VA_ARGS__ -/** - * @internal - * @brief Token-paste two macro arguments, after macro expansion - */ +// Token-paste two macro arguments, after macro expansion #define BSONCXX_CONCAT(A, ...) BSONCXX_CONCAT_IMPL(A, __VA_ARGS__) #define BSONCXX_CONCAT_IMPL(A, ...) A##__VA_ARGS__ -/** - * @internal - * @brief Expands to a _Pragma() preprocessor directive, after macro expansion - * - * The arguments an arbitrary "token soup", and should not be quoted like a regular - * _Pragma. This macro will stringify-them itself. - * - * Example: - * - * BSONCXX_PRAGMA(GCC diagnostic ignore "-Wconversion") - * - * will become: - * - * _Pragma("GCC diagnostic ignore \"-Wconversion\"") - * - */ +// Expands to a _Pragma() preprocessor directive, after macro expansion +// +// The arguments an arbitrary "token soup", and should not be quoted like a regular +// _Pragma. This macro will stringify-them itself. +// +// Example: +// +// BSONCXX_PRAGMA(GCC diagnostic ignore "-Wconversion") +// +// will become: +// +// _Pragma("GCC diagnostic ignore \"-Wconversion\"") +// #define BSONCXX_PRAGMA(...) _bsoncxxPragma(__VA_ARGS__) #ifdef _MSC_VER // Old MSVC doesn't recognize C++11 _Pragma(), but it always recognized __pragma @@ -37,87 +27,69 @@ #define _bsoncxxPragma(...) _Pragma(BSONCXX_STRINGIFY(__VA_ARGS__)) #endif -/** - * @internal - * @brief Use in a declaration position to force the appearence of a semicolon - * as the next token. Use this for statement-like or declaration-like macros to - * enforce that their call sites are followed by a semicolon - */ +// Use in a declaration position to force the appearence of a semicolon +// as the next token. Use this for statement-like or declaration-like macros to +// enforce that their call sites are followed by a semicolon #define BSONCXX_FORCE_SEMICOLON static_assert(true, "") -/** - * @internal - * @brief Add a trailing noexcept, decltype-return, and return-body to a - * function definition. (Not compatible with lambda expressions.) - * - * Example: - * - * template - * auto foo(T x, T y) BSONCXX_RETURNS(x + y); - * - * Becomes: - * - * template - * auto foo(T x, T y) noexcept(noexcept(x + y)) - * -> decltype(x + y) - * { return x + y }; - * - */ +// Add a trailing noexcept, decltype-return, and return-body to a +// function definition. (Not compatible with lambda expressions.) +// +// Example: +// +// template +// auto foo(T x, T y) BSONCXX_RETURNS(x + y); +// +// Becomes: +// +// template +// auto foo(T x, T y) noexcept(noexcept(x + y)) +// -> decltype(x + y) +// { return x + y }; +// #define BSONCXX_RETURNS(...) \ noexcept(noexcept(__VA_ARGS__))->decltype(__VA_ARGS__) { \ return __VA_ARGS__; \ } \ BSONCXX_FORCE_SEMICOLON -/** - * @internal - * @macro mongocxx_cxx14_constexpr - * @brief Expands to `constexpr` if compiling as c++14 or greater, otherwise - * expands to `inline`. - * - * Use this on functions that can only be constexpr in C++14 or newer, including - * non-const member functions. - */ +// @macro mongocxx_cxx14_constexpr +// Expands to `constexpr` if compiling as c++14 or greater, otherwise +// expands to `inline`. +// +// Use this on functions that can only be constexpr in C++14 or newer, including +// non-const member functions. #if __cplusplus >= 201402L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L && _MSC_VER > 1910) #define bsoncxx_cxx14_constexpr constexpr #else #define bsoncxx_cxx14_constexpr inline #endif -/** - * @internal - * @brief Disable a warning for a particular compiler. - * - * The argument should be of the form: - * - * - Clang() - * - GCC() - * - GNU() - * - MSVC() - * - * The "GNU" form applies to both GCC and Clang - */ -#define BSONCXX_DISABLE_WARNING(Spec) \ +// Disable a warning for a particular compiler. +// +// The argument should be of the form: +// +// - Clang() +// - GCC() +// - GNU() +// - MSVC() +// +// The "GNU" form applies to both GCC and Clang +#define BSONCXX_DISABLE_WARNING(Spec) \ BSONCXX_CONCAT(_bsoncxxDisableWarningImpl_for_, Spec) \ BSONCXX_FORCE_SEMICOLON -/** - * @internal - * @brief Push the current compiler diagnostics settings state - */ -#define BSONCXX_PUSH_WARNINGS() \ +// Push the current compiler diagnostics settings state +#define BSONCXX_PUSH_WARNINGS() \ BSONCXX_IF_GNU_LIKE(BSONCXX_PRAGMA(GCC diagnostic push)) \ - BSONCXX_IF_MSVC(BSONCXX_PRAGMA(warning(push))) \ + BSONCXX_IF_MSVC(BSONCXX_PRAGMA(warning(push))) \ BSONCXX_FORCE_SEMICOLON -/** - * @internal - * @brief Restore prior compiler diagnostics settings from before the most - * recent BSONCXX_PUSH_WARNINGS() - */ -#define BSONCXX_POP_WARNINGS() \ +// Restore prior compiler diagnostics settings from before the most +// recent BSONCXX_PUSH_WARNINGS() +#define BSONCXX_POP_WARNINGS() \ BSONCXX_IF_GNU_LIKE(BSONCXX_PRAGMA(GCC diagnostic pop)) \ - BSONCXX_IF_MSVC(BSONCXX_PRAGMA(warning(pop))) \ + BSONCXX_IF_MSVC(BSONCXX_PRAGMA(warning(pop))) \ BSONCXX_FORCE_SEMICOLON #define _bsoncxxDisableWarningImpl_for_GCC(...) \ @@ -126,9 +98,9 @@ #define _bsoncxxDisableWarningImpl_for_Clang(...) \ BSONCXX_IF_CLANG(BSONCXX_PRAGMA(GCC diagnostic ignored __VA_ARGS__)) -#define _bsoncxxDisableWarningImpl_for_GNU(...) \ +#define _bsoncxxDisableWarningImpl_for_GNU(...) \ _bsoncxxDisableWarningImpl_for_GCC(__VA_ARGS__) \ - _bsoncxxDisableWarningImpl_for_Clang(__VA_ARGS__) + _bsoncxxDisableWarningImpl_for_Clang(__VA_ARGS__) #define _bsoncxxDisableWarningImpl_for_MSVC(...) \ BSONCXX_IF_MSVC(BSONCXX_PRAGMA(warning(disable : __VA_ARGS__))) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/decimal128-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/decimal128-fwd.hpp index 1da28e9308..0bac27c789 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/decimal128-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/decimal128-fwd.hpp @@ -31,3 +31,19 @@ using ::bsoncxx::v_noabi::decimal128; } // namespace bsoncxx #include + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::decimal128. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { + +/// @ref bsoncxx::v_noabi::decimal128 +class decimal128 {}; + +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/decimal128.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/decimal128.hpp index 5bdb8c4c93..19e9dc72ed 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/decimal128.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/decimal128.hpp @@ -98,3 +98,8 @@ class decimal128 { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::decimal128. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element-fwd.hpp index a511c8cc6a..4160723ddf 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element-fwd.hpp @@ -35,3 +35,21 @@ using ::bsoncxx::v_noabi::document::element; } // namespace bsoncxx #include + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::document::element. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace document { + +/// @ref bsoncxx::v_noabi::document::element +class element {}; + +} // namespace document +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element.hpp index 8240b5dd0b..3a7906c088 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element.hpp @@ -422,3 +422,30 @@ using ::bsoncxx::v_noabi::document::operator!=; } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::document::element. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace document { + +/// @ref bsoncxx::v_noabi::document::operator==(const v_noabi::document::element& elem, const v_noabi::types::bson_value::view& v) +bool operator==(const v_noabi::document::element& elem, const v_noabi::types::bson_value::view& v); + +/// @ref bsoncxx::v_noabi::document::operator==(const v_noabi::types::bson_value::view& v, const v_noabi::document::element& elem) +bool operator==(const v_noabi::types::bson_value::view& v, const v_noabi::document::element& elem); + +/// @ref bsoncxx::v_noabi::document::operator!=(const v_noabi::document::element& elem, const v_noabi::types::bson_value::view& v) +bool operator!=(const v_noabi::document::element& elem, const v_noabi::types::bson_value::view& v); + +/// @ref bsoncxx::v_noabi::document::operator!=(const v_noabi::types::bson_value::view& v, const v_noabi::document::element& elem) +bool operator!=(const v_noabi::types::bson_value::view& v, const v_noabi::document::element& elem); + +} // namespace document +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/value-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/value-fwd.hpp index 458220440d..e5a8402dba 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/value-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/value-fwd.hpp @@ -35,3 +35,21 @@ using ::bsoncxx::v_noabi::document::value; } // namespace bsoncxx #include + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::document::value. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace document { + +/// @ref bsoncxx::v_noabi::document::value +class value {}; + +} // namespace document +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp index 622d77d4b8..6b7aac1180 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp @@ -281,3 +281,24 @@ using ::bsoncxx::v_noabi::document::operator!=; } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::document::value. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace document { + +/// @ref bsoncxx::v_noabi::document::operator==(const v_noabi::document::value& lhs, const v_noabi::document::value& rhs) +inline bool operator==(const v_noabi::document::value& lhs, const v_noabi::document::value& rhs); + +/// @ref bsoncxx::v_noabi::document::operator!=(const v_noabi::document::value& lhs, const v_noabi::document::value& rhs) +inline bool operator!=(const v_noabi::document::value& lhs, const v_noabi::document::value& rhs); + +} // namespace document +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view-fwd.hpp index b0325279ca..d3054a09d4 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view-fwd.hpp @@ -35,3 +35,21 @@ using ::bsoncxx::v_noabi::document::view; } // namespace bsoncxx #include + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::document::view. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace document { + +/// @ref bsoncxx::v_noabi::document::view +class view {}; + +} // namespace document +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view.hpp index af1b5e5f62..7f5586c522 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view.hpp @@ -190,3 +190,8 @@ class view::const_iterator { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::document::view. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view_or_value.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view_or_value.hpp index ca9083218b..46d485fc2c 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view_or_value.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view_or_value.hpp @@ -42,3 +42,21 @@ using ::bsoncxx::v_noabi::document::view_or_value; } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::document::view_or_value. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace document { + +/// @ref bsoncxx::v_noabi::document::view_or_value +class view_or_value {}; + +} // namespace document +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/enums/binary_sub_type.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/enums/binary_sub_type.hpp index e888f8b212..a4489f65d9 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/enums/binary_sub_type.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/enums/binary_sub_type.hpp @@ -26,3 +26,13 @@ BSONCXX_ENUM(encrypted, 0x06) BSONCXX_ENUM(column, 0x07) BSONCXX_ENUM(sensitive, 0x08) BSONCXX_ENUM(user, 0x80) + +/// +/// @file +/// X macro header expanding the user-provided `BSONCXX_ENUM` macro over BSON binary subtypes. +/// +/// @warning The `BSONCXX_ENUM` macro must be defined by the user prior to including this header! +/// +/// The user-provided `BSONCXX_ENUM` macro must accept two arguments: the name of the binary subtype +/// corresponding value. See the source code for the list of expanded types and values. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/enums/type.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/enums/type.hpp index 1bcb58c97e..2fc99d6d3c 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/enums/type.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/enums/type.hpp @@ -37,3 +37,13 @@ BSONCXX_ENUM(int64, 0x12) BSONCXX_ENUM(decimal128, 0x13) BSONCXX_ENUM(maxkey, 0x7F) BSONCXX_ENUM(minkey, 0xFF) + +/// +/// @file +/// X macro header expanding the user-provided `BSONCXX_ENUM` macro over BSON types. +/// +/// @warning The `BSONCXX_ENUM` macro must be defined by the user prior to including this header! +/// +/// The user-provided `BSONCXX_ENUM` macro must accept two arguments: the name of the type and the +/// corresponding value. See the source code for the list of expanded types and values. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/error_code-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/error_code-fwd.hpp index ea7ae20065..655c6984cd 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/error_code-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/error_code-fwd.hpp @@ -37,3 +37,19 @@ template <> struct is_error_code_enum; } // namespace std + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::error_code. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { + +/// @ref bsoncxx::v_noabi::error_code +class error_code {}; + +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/error_code.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/error_code.hpp index 5a59ae049a..d460380250 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/error_code.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/error_code.hpp @@ -42,9 +42,13 @@ enum class error_code : std::int32_t { /// A document operation was performed while building an array. k_cannot_perform_document_operation_on_array, + +// @cond DOXYGEN_DISABLE #define BSONCXX_ENUM(name, value) k_need_element_type_k_##name, #include #undef BSONCXX_ENUM + // @endcond DOXYGEN_DISABLE + /// No key was provided when one was needed. k_need_key, @@ -54,7 +58,7 @@ enum class error_code : std::int32_t { /// A document was closed while no document was open. k_no_document_to_close, - // Attempted to view or extract a document when a key was still awaiting a matching value. + /// Attempted to view or extract a document when a key was still awaiting a matching value. k_unmatched_key_in_builder, /// An empty element was accessed. @@ -66,7 +70,7 @@ enum class error_code : std::int32_t { /// An Object ID string failed to parse. k_invalid_oid, - // This type is unused and deprecated. + /// This type is unused and deprecated. k_failed_converting_bson_to_json, /// A Decimal128 string failed to parse. @@ -93,12 +97,18 @@ enum class error_code : std::int32_t { /// Invalid type. k_invalid_bson_type_id, -/// A value failed to append. +// @cond DOXYGEN_DISABLE #define BSONCXX_ENUM(name, value) k_cannot_append_##name, #include #undef BSONCXX_ENUM + // @endcond DOXYGEN_DISABLE + + /// A value failed to append. k_cannot_append_utf8 = k_cannot_append_string, + + /// @deprecated Use `k_need_element_type_k_string` instead. k_need_element_type_k_utf8 = k_need_element_type_k_string, + // Add new constant string message to error_code.cpp as well! }; @@ -133,8 +143,30 @@ using ::bsoncxx::v_noabi::make_error_code; namespace std { -// Specialize is_error_code_enum so we get simpler std::error_code construction +/// +/// Indicates @ref bsoncxx::v_noabi::error_code is eligible for `std::error_code` implicit +/// conversions. +/// template <> struct is_error_code_enum : public true_type {}; } // namespace std + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::error_code. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { + +/// @ref bsoncxx::v_noabi::error_category() +const std::error_category& error_category(); + +/// @ref bsoncxx::v_noabi::make_error_code(v_noabi::error_code error) +std::error_code make_error_code(v_noabi::error_code error); + +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/exception-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/exception-fwd.hpp index b7facb85da..516df7d0db 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/exception-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/exception-fwd.hpp @@ -31,3 +31,19 @@ using ::bsoncxx::v_noabi::exception; } // namespace bsoncxx #include + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::exception. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { + +/// @ref bsoncxx::v_noabi::exception +class exception {}; + +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/exception.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/exception.hpp index 07761629fd..d474d4dc9b 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/exception.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/exception/exception.hpp @@ -35,3 +35,8 @@ class exception : public std::system_error { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::exception. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json-fwd.hpp index 28118206c3..78f328094c 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json-fwd.hpp @@ -29,3 +29,19 @@ namespace bsoncxx { using ::bsoncxx::v_noabi::ExtendedJsonMode; } // namespace bsoncxx + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::ExtendedJsonMode. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { + +/// @ref bsoncxx::v_noabi::ExtendedJsonMode +enum class ExtendedJsonMode {}; + +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json.hpp index 2b7a9dff4b..b20a49d0ff 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json.hpp @@ -40,7 +40,7 @@ enum class ExtendedJsonMode : std::uint8_t { /// Converts a BSON document to a JSON string, in extended format. /// /// @param view -/// A valid BSON document. +/// A valid BSON document or array. /// @param mode /// An optional JSON representation mode. /// @@ -48,12 +48,17 @@ enum class ExtendedJsonMode : std::uint8_t { /// /// @returns An extended JSON string. /// +/// @{ + BSONCXX_API std::string BSONCXX_CALL to_json(document::view view, ExtendedJsonMode mode = ExtendedJsonMode::k_legacy); BSONCXX_API std::string BSONCXX_CALL to_json(array::view view, ExtendedJsonMode mode = ExtendedJsonMode::k_legacy); +/// @} +/// + /// /// Constructs a new document::value from the provided JSON text. /// @@ -92,3 +97,31 @@ using ::bsoncxx::v_noabi::operator""_bson; } // namespace bsoncxx #include + +/// +/// @file +/// Provides utilities to convert between BSON and JSON representations. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { + +/// @ref bsoncxx::v_noabi::to_json(v_noabi::document::view view, v_noabi::ExtendedJsonMode mode) +std::string to_json(v_noabi::document::view view, + v_noabi::ExtendedJsonMode mode = ExtendedJsonMode::k_legacy); + +/// @ref bsoncxx::v_noabi::to_json(v_noabi::array::view view, v_noabi::ExtendedJsonMode mode) +std::string to_json(v_noabi::array::view view, + v_noabi::ExtendedJsonMode mode = ExtendedJsonMode::k_legacy); + +/// @ref bsoncxx::v_noabi::from_json(v_noabi::stdx::string_view json) +v_noabi::document::value from_json(v_noabi::stdx::string_view json); + +// Space is required between `operator` and `""` in @ref to avoid confusing Doxygen. +/// @ref bsoncxx::v_noabi::operator ""_bson(const char* json, size_t len) +v_noabi::document::value operator""_bson(const char* json, std::size_t len); + +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/oid-fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/oid-fwd.hpp index baf7c9166b..a7db1f3fb6 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/oid-fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/oid-fwd.hpp @@ -31,3 +31,19 @@ using ::bsoncxx::v_noabi::oid; } // namespace bsoncxx #include + +/// +/// @file +/// Declares @ref bsoncxx::v_noabi::oid. +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { + +/// @ref bsoncxx::v_noabi::oid +class oid {}; + +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/oid.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/oid.hpp index bf516cec32..eb4f5ba1bf 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/oid.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/oid.hpp @@ -125,3 +125,8 @@ class oid { } // namespace bsoncxx #include + +/// +/// @file +/// Provides @ref bsoncxx::v_noabi::oid. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/make_unique.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/make_unique.hpp index 36aeb4f7e7..cbc4a5484d 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/make_unique.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/make_unique.hpp @@ -112,7 +112,8 @@ namespace stdx { using ::std::make_unique; #else -/// Equivalent to `std::make_unique(args...)` where `T` is a non-array type. +// Equivalent to `std::make_unique(args...)` where `T` is a non-array type. +// @cond DOXYGEN_DISABLE template , @@ -122,8 +123,10 @@ template make_unique(Args&&... args) { return Impl::make(std::true_type{}, std::forward(args)...); } +// @endcond -/// Equivalent to `std::make_unique(count)` where `T` is an array type. +// Equivalent to `std::make_unique(count)` where `T` is an array type. +// @cond DOXYGEN_DISABLE template < typename T, typename Impl = detail::make_unique_impl, @@ -133,6 +136,7 @@ template < std::unique_ptr make_unique(std::size_t count) { return Impl::make(std::true_type{}, count); } +// @endcond DOXYGEN_DISABLE #endif @@ -142,7 +146,7 @@ std::unique_ptr make_unique(std::size_t count) { using ::std::make_unique_for_overwrite; #else -/// Equivalent to `std::make_unique_for_overwrite()` where `T` is a non-array type. +// Equivalent to `std::make_unique_for_overwrite()` where `T` is a non-array type. template , typename std::enable_if::value, @@ -151,7 +155,7 @@ std::unique_ptr make_unique_for_overwrite() { return Impl::make(std::false_type{}); } -/// Equivalent to `std::make_unique_for_overwrite(count)` where `T` is an array type. +// Equivalent to `std::make_unique_for_overwrite(count)` where `T` is an array type. template < typename T, typename Impl = detail::make_unique_impl, @@ -180,3 +184,52 @@ 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/include/bsoncxx/v_noabi/bsoncxx/stdx/operators.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/operators.hpp index 756c9e6cbb..544c7c4d06 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/operators.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/operators.hpp @@ -28,27 +28,23 @@ namespace detail { template auto is_equality_comparable_f(...) -> std::false_type; +BSONCXX_PUSH_WARNINGS(); +BSONCXX_DISABLE_WARNING(GNU("-Wfloat-equal")); template -auto is_equality_comparable_f(int, - bool b = false, - const_reference_t l = soft_declval(), - const_reference_t r = soft_declval()) - -> true_t; - -/** - * @brief Detect whether two types are equality-comparable. - * - * Requires L == R, L != R, R == L, and R != L - */ +auto is_equality_comparable_f(int, bool b = false) + -> true_t() == std::declval()) ? 0 : 0, // + (std::declval() == std::declval()) ? 0 : 0, + (std::declval() != std::declval()) ? 0 : 0, + (std::declval() != std::declval()) ? 0 : 0)>; +BSONCXX_POP_WARNINGS(); + +// Detect whether two types are equality-comparable. +// +// Requires L == R, L != R, R == L, and R != L. template struct is_equality_comparable : decltype(is_equality_comparable_f(0)) {}; -/** - * @brief Callable object and tag type for equality comparison - */ +// Callable object and tag type for equality comparison. struct equal_to { template constexpr requires_t> // @@ -57,10 +53,8 @@ struct equal_to { } }; -/** - * @brief Derive from this class to define ADL-only operator== and operator!= on the basis of - * an ADL-only tag_invoke(equal_to, l, r) - */ +// Derive from this class to define ADL-only operator== and operator!= on the basis of +// an ADL-only tag_invoke(equal_to, l, r). class equality_operators { template constexpr static auto impl(rank<1>, L& l, R& r) BSONCXX_RETURNS(tag_invoke(equal_to{}, l, r)); @@ -68,20 +62,22 @@ class equality_operators { template constexpr static auto impl(rank<0>, L& l, R& r) BSONCXX_RETURNS(tag_invoke(equal_to{}, r, l)); + // @cond DOXYGEN_DISABLE "Found ';' while parsing initializer list!" template constexpr friend auto operator==(const Left& self, const Other& other) BSONCXX_RETURNS(equality_operators::impl(rank<1>{}, self, other)); + // @endcond + // @cond DOXYGEN_DISABLE "Found ';' while parsing initializer list!" template constexpr friend auto operator!=(const Left& self, const Other& other) BSONCXX_RETURNS(!equality_operators::impl(rank<1>{}, self, other)); + // @endcond }; -/** - * @brief Very basic impl of C++20 std::strong_ordering - * - * We don't need other weaker orderings yet, so this is all that we have - */ +// Very basic impl of C++20 std::strong_ordering. +// +// We don't need other weaker orderings yet, so this is all that we have. class strong_ordering { signed char _c; struct _construct {}; @@ -136,12 +132,12 @@ INLINE_VAR const strong_ordering strong_ordering::equal = #pragma pop_macro("INLINE_VAR") -/** - * @brief Implements a three-way comparison between two objects. That is, in - * a single operation, determine whether the left operand is less-than, greater-than, - * or equal-to the right-hand operand. - */ +// Implements a three-way comparison between two objects. That is, in +// a single operation, determine whether the left operand is less-than, greater-than, +// or equal-to the right-hand operand. struct compare_three_way { + BSONCXX_PUSH_WARNINGS(); + BSONCXX_DISABLE_WARNING(GNU("-Wfloat-equal")); template () < std::declval()), @@ -151,6 +147,7 @@ struct compare_three_way { : (l == r ? strong_ordering::equal // : strong_ordering::greater); } + BSONCXX_POP_WARNINGS(); template {})); }; -/** - * @brief Inherit to define ADL-visible ordering operators based on an ADL-visible - * implementation of tag_invoke(compare_three_way, l, r) - */ +// Inherit to define ADL-visible ordering operators based on an ADL-visible +// implementation of tag_invoke(compare_three_way, l, r). struct ordering_operators { template constexpr static auto impl(const L& l, const R& r, rank<1>) @@ -183,7 +178,7 @@ struct ordering_operators { #define DEFOP(Oper) \ template \ constexpr friend auto operator Oper(const L& l, const R& r) \ - BSONCXX_RETURNS(ordering_operators::impl(l, r, rank<1>{}) Oper 0) + BSONCXX_RETURNS(ordering_operators::impl(l, r, rank<1>{}) Oper nullptr) DEFOP(<); DEFOP(>); DEFOP(<=); @@ -191,21 +186,19 @@ struct ordering_operators { #pragma pop_macro("DEFOP") }; -template +template std::false_type is_partially_ordered_with_f(rank<0>); -template -auto is_partially_ordered_with_f(rank<1>, - const T& l = soft_declval(), - const U& r = soft_declval()) // - -> true_t r), - decltype(l < r), - decltype(l >= r), - decltype(l <= r), - decltype(r < l), - decltype(r > l), - decltype(r <= l), - decltype(r >= l)>; +template +auto is_partially_ordered_with_f(rank<1>) + -> true_t() > std::declval()), + decltype(std::declval() < std::declval()), + decltype(std::declval() >= std::declval()), + decltype(std::declval() <= std::declval()), + decltype(std::declval() < std::declval()), + decltype(std::declval() > std::declval()), + decltype(std::declval() <= std::declval()), + decltype(std::declval() >= std::declval())>; template struct is_partially_ordered_with : decltype(is_partially_ordered_with_f(rank<1>{})) {}; @@ -224,3 +217,10 @@ struct is_totally_ordered_with : conjunction, } // namespace bsoncxx #include + +/// +/// @file +/// Provides comparison-related utilities for internal use. +/// +/// @warning For internal use only! +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/optional.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/optional.hpp index 3241757ad9..9eaaf820ea 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/optional.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/optional.hpp @@ -86,6 +86,7 @@ using ::std::optional; #include #include #include +#include #include #include #include @@ -99,48 +100,47 @@ namespace v_noabi { namespace stdx { -/** - * @brief Implementation of an std::optional-like class template - * - * Presents mostly the same interface as std::optional from C++17. - * - * @tparam T The type being made "optional" - */ template class optional; -/** - * @brief Exception type thrown upon attempted access to a value-less optional - * via a throwing accessor API. - */ +BSONCXX_PUSH_WARNINGS(); +BSONCXX_DISABLE_WARNING(Clang("-Wweak-vtables")); +// Exception type thrown upon attempted access to a value-less optional via a throwing accessor +// API. class bad_optional_access : public std::exception { public: const char* what() const noexcept override { return "bad_optional_access()"; } }; -/// Tag type to represent an empty optional value +BSONCXX_POP_WARNINGS(); + +// Tag type to represent an empty optional value. struct nullopt_t { explicit constexpr nullopt_t(std::nullptr_t) noexcept {} }; -/// Tag constant to construct or compare with an empty optional value + +// Tag constant to construct or compare with an empty optional value. static constexpr nullopt_t nullopt{nullptr}; -/// Tag used to call the emplacement-constructor of optional + +// Tag used to call the emplacement-constructor of optional. static constexpr struct in_place_t { } in_place; namespace detail { -// Terminates the program when an illegal use of optional is attempted +// Terminates the program when an illegal use of optional is attempted. [[noreturn]] inline void terminate_disengaged_optional(const char* what) noexcept { (void)std::fprintf(stderr, "%s: Invalid attempted use of disengaged optional\n", what); std::terminate(); } -// Throws bad_optional_access for throwing optional member functions + +// Throws bad_optional_access for throwing optional member functions. [[noreturn]] inline void throw_bad_optional() { throw bad_optional_access(); } -// Base class of std::optional. Implementation detail, defined later + +// Base class of std::optional. Implementation detail, defined later. template struct optional_base_class; @@ -152,7 +152,7 @@ std::true_type not_an_optional_f(const T&); template std::false_type not_an_optional_f(const optional&); -// Utility trait to detect specializations of stdx::optional +// Utility trait to detect specializations of stdx::optional. template struct not_an_optional : decltype(not_an_optional_f(std::declval())) {}; @@ -189,36 +189,34 @@ class optional : bsoncxx::detail::equality_operators, bsoncxx::detail::ordering_operators, public detail::optional_base_class::type { public: - /// The type of value held within this optional using value_type = T; - /// An lvalue-reference-to-mutable T using reference = bsoncxx::detail::add_lvalue_reference_t; - /// An lvalue-reference-to-const T using const_reference = bsoncxx::detail::add_lvalue_reference_t>; - /// An rvalue-reference-to-mutable T using rvalue_reference = bsoncxx::detail::add_rvalue_reference_t; - /// An rvalue-reference-to-const T using const_rvalue_reference = bsoncxx::detail::add_rvalue_reference_t>; - /// A pointer-to-mutable T using pointer = bsoncxx::detail::add_pointer_t; - /// A pointer-to-const T using const_pointer = bsoncxx::detail::add_pointer_t; - // Constructors [1] + // Constructors [1]. + optional() = default; constexpr optional(nullopt_t) noexcept {} - // Ctor [2] and [3] are provided by base classes + // Ctor [2] and [3] are provided by base classes. + optional(const optional&) = default; optional(optional&&) = default; + // Same with assignments + optional& operator=(const optional&) = default; optional& operator=(optional&&) = default; ~optional() = default; // In-place constructors + template bsoncxx_cxx14_constexpr explicit optional(in_place_t, Args&&... args) noexcept( noexcept(T(BSONCXX_FWD(args)...))) { @@ -306,7 +304,8 @@ class optional : bsoncxx::detail::equality_operators, return this->has_value(); } - // Unchecked dereference operators + // Unchecked dereference operators. + bsoncxx_cxx14_constexpr reference operator*() & noexcept { _assert_has_value("operator*() &"); return this->_storage.value; @@ -324,7 +323,8 @@ class optional : bsoncxx::detail::equality_operators, return static_cast(**this); } - // (Unchecked) member-access operators + // (Unchecked) member-access operators. + bsoncxx_cxx14_constexpr pointer operator->() noexcept { _assert_has_value("operator->()"); return std::addressof(**this); @@ -334,7 +334,8 @@ class optional : bsoncxx::detail::equality_operators, return std::addressof(**this); } - // Checked accessors + // Checked accessors. + bsoncxx_cxx14_constexpr reference value() & { _throw_if_empty(); return **this; @@ -352,7 +353,8 @@ class optional : bsoncxx::detail::equality_operators, return static_cast(**this); } - // Checked value-or-alternative + // Checked value-or-alternative. + template bsoncxx_cxx14_constexpr value_type value_or(U&& dflt) const& { if (has_value()) { @@ -385,35 +387,27 @@ class optional : bsoncxx::detail::equality_operators, } }; -/** - * @brief Construct an optional by decay-copying the given value into a new - * optional> - * - * @param value The value being made into an optional - */ +// Construct an optional by decay-copying the given value into a new optional>. +// +// @param value The value being made into an optional. template bsoncxx_cxx14_constexpr optional> make_optional(T&& value) noexcept( std::is_nothrow_constructible, T&&>::value) { return optional>(BSONCXX_FWD(value)); } -/** - * @brief Emplace-construct a new optional of the given type with the given - * constructor arguments - * - * @tparam T The type to be constructed - * @param args Constructor arguments - */ +// Emplace-construct a new optional of the given type with the given constructor arguments. +// +// @tparam T The type to be constructed +// @param args Constructor arguments template bsoncxx_cxx14_constexpr optional make_optional(Args&&... args) noexcept( std::is_nothrow_constructible::value) { return optional(in_place, BSONCXX_FWD(args)...); } -/** - * @brief Emplace-construct a new optional of the given type with the given - * arguments (accepts an init-list as the first argument) - */ +// Emplace-construct a new optional of the given type with the given arguments (accepts an init-list +// as the first argument). template bsoncxx_cxx14_constexpr optional make_optional(std::initializer_list il, Args&&... args) noexcept( @@ -423,9 +417,7 @@ make_optional(std::initializer_list il, Args&&... args) noexcept( namespace detail { -/** - * @brief Union template that defines the storage for an optional's data. - */ +// Union template that defines the storage for an optional's data. template ::value> union storage_for { // Placeholder member for disengaged optional @@ -452,14 +444,14 @@ union storage_for { storage_for& operator=(const storage_for&) = delete; }; -// Whether a type is copyable, moveable, or immobile +// Whether a type is copyable, moveable, or immobile. enum copymove_classification { copyable, movable, immobile, }; -/// Classify the constructibility of the given type +// Classify the constructibility of the given type. template ::value, bool CanMove = std::is_move_constructible::value> @@ -467,7 +459,7 @@ constexpr copymove_classification classify_construct() { return CanCopy ? copyable : CanMove ? movable : immobile; } -/// Classify the assignability of the given type +// Classify the assignability of the given type. template ::value, bool CanMove = std::is_move_assignable::value> @@ -475,15 +467,17 @@ constexpr copymove_classification classify_assignment() { return CanCopy ? copyable : CanMove ? movable : immobile; } -/// Common base class for optional storage implementation +// Common base class for optional storage implementation +// +// @tparam T template class optional_common_base; -/// Define the special member constructors for optional +// Define the special member constructors for optional. template ()> struct optional_construct_base; -/// Define the special member assignment operators for optional +// Define the special member assignment operators for optional. template ()> struct optional_assign_base; @@ -499,15 +493,19 @@ struct optional_assign_base : optional_construct_base {}; template struct optional_assign_base : optional_construct_base { - // Constructors defer to base + // Constructors defer to base. + optional_assign_base() = default; optional_assign_base(optional_assign_base const&) = default; optional_assign_base(optional_assign_base&&) = default; ~optional_assign_base() = default; - // No copy + // Disallow copies. + bsoncxx_cxx14_constexpr optional_assign_base& operator=(const optional_assign_base&) = delete; - // Allow move-assign: + + // Allow move-assignment. + bsoncxx_cxx14_constexpr optional_assign_base& operator=(optional_assign_base&& other) = default; }; @@ -548,12 +546,14 @@ template <> struct optional_destruct_helper { template struct base : optional_common_base { - // Special members defer to base + // Special members defer to base. + base() = default; base(base const&) = default; base(base&&) = default; base& operator=(const base&) = default; base& operator=(base&&) = default; + ~base() { // Here we destroy the contained object during destruction. this->reset(); @@ -563,12 +563,13 @@ struct optional_destruct_helper { template <> struct optional_destruct_helper { - // Just fall-through to the common base, which has no special destructor + // Just fall-through to the common base, which has no special destructor. + template using base = optional_common_base; }; -// Optional's ADL-only operators live here: +// Optional's ADL-only operators are defined here. struct optional_operators_base { template friend bsoncxx_cxx14_constexpr auto tag_invoke(bsoncxx::detail::equal_to, @@ -578,7 +579,11 @@ struct optional_operators_base { if (left.has_value() != right.has_value()) { return false; } + + BSONCXX_PUSH_WARNINGS(); + BSONCXX_DISABLE_WARNING(GNU("-Wfloat-equal")); return !left.has_value() || *left == *right; + BSONCXX_POP_WARNINGS(); } template @@ -586,7 +591,10 @@ struct optional_operators_base { optional const& left, U const& right) noexcept -> bsoncxx::detail:: requires_t, bsoncxx::detail::is_equality_comparable> { + BSONCXX_PUSH_WARNINGS(); + BSONCXX_DISABLE_WARNING(GNU("-Wfloat-equal")); return left.has_value() && *left == right; + BSONCXX_POP_WARNINGS(); } template @@ -606,15 +614,15 @@ struct optional_operators_base { if (right.has_value()) { return compare(*left, *right); } else { - // non-null is greater than any null + // Non-null is greater than any null. return bsoncxx::detail::strong_ordering::greater; } } else { if (right.has_value()) { - // Null is less than any non-null + // Null is less than any non-null. return bsoncxx::detail::strong_ordering::less; } else { - // Both are null + // Both are null. return bsoncxx::detail::strong_ordering::equal; } } @@ -630,7 +638,7 @@ struct optional_operators_base { if (left.has_value()) { return compare(*left, right); } - // null optional is less-than any non-null value + // Null optional is less-than any non-null value. return bsoncxx::detail::strong_ordering::less; } @@ -654,7 +662,7 @@ struct optional_swap_mixin { } }; -// Common base class of all optionals +// Common base class of all optionals. template class optional_common_base : optional_operators_base, optional_swap_mixin { using storage_type = detail::storage_for>; @@ -689,10 +697,7 @@ class optional_common_base : optional_operators_base, optional_swap_mixin { return *this; } - /** - * @internal - * @brief If the optional is holding a value, destroy that value and set ourselves null - */ + // If the optional is holding a value, destroy that value and set ourselves null. void reset() noexcept { if (this->_has_value) { this->_storage.value.~T(); @@ -700,11 +705,8 @@ class optional_common_base : optional_operators_base, optional_swap_mixin { this->_has_value = false; } - /** - * @internal - * @brief If the optional is holding a value, destroy that value. Construct - * a new value in-place using the given arguments. - */ + // If the optional is holding a value, destroy that value. Construct a new value in-place using + // the given arguments. template T& emplace(Args&&... args) { this->reset(); @@ -712,11 +714,8 @@ class optional_common_base : optional_operators_base, optional_swap_mixin { return this->_storage.value; } - /** - * @internal - * @brief If the optional is holding a value, destroy that value. Construct - * a new value in-place using the given arguments. - */ + // If the optional is holding a value, destroy that value. Construct a new value in-place using + // the given arguments. template T& emplace(std::initializer_list il, Args&&... args) { this->reset(); @@ -724,20 +723,17 @@ class optional_common_base : optional_operators_base, optional_swap_mixin { return this->_storage.value; } - /** - * @internal - * @brief Special swap for optional values that removes need for a temporary - */ + // Special swap for optional values that removes need for a temporary. bsoncxx_cxx14_constexpr void swap(optional_common_base& other) noexcept( std::is_nothrow_move_constructible::value&& bsoncxx::detail::is_nothrow_swappable::value) { if (other._has_value) { if (this->_has_value) { using std::swap; - // Defer to the underlying swap + // Defer to the underlying swap. swap(this->_storage.value, other._storage.value); } else { - // "steal" the other's value + // "steal" the other's value. this->emplace(std::move(other._storage.value)); other.reset(); } @@ -745,7 +741,7 @@ class optional_common_base : optional_operators_base, optional_swap_mixin { other.emplace(std::move(this->_storage.value)); this->reset(); } else { - // Neither optional has a value, so do nothing + // Neither optional has a value, so do nothing. } } @@ -754,11 +750,8 @@ class optional_common_base : optional_operators_base, optional_swap_mixin { storage_type _storage; bool _has_value = false; - /** - * @internal - * @brief In-place construct a new value from the given arguments. Assumes - * that the optional does not have a live value. - */ + // In-place construct a new value from the given arguments. Assumes that the optional does not + // have a live value. template void _emplace_construct_anew(Args&&... args) noexcept( std::is_nothrow_constructible::value) { @@ -766,14 +759,11 @@ class optional_common_base : optional_operators_base, optional_swap_mixin { this->_has_value = true; } - /** - * @internal - * @brief Perform the semantics of the assignment operator. - */ + // Perform the semantics of the assignment operator. template void _assign(U&& other_storage) { if (other_storage._has_value) { - // We are receiving a value + // We are receiving a value. if (this->_has_value) { // We already have a value. Invoke the underlying assignment. this->_storage.value = BSONCXX_FWD(other_storage)._storage.value; @@ -782,7 +772,7 @@ class optional_common_base : optional_operators_base, optional_swap_mixin { this->_emplace_construct_anew(BSONCXX_FWD(other_storage)._storage.value); } } else { - // We are receiving nullopt. Destroy our value, if present: + // We are receiving nullopt. Destroy our value, if present. this->reset(); } } @@ -799,7 +789,7 @@ template struct optional_hash { optional_hash() = delete; @@ -854,3 +844,37 @@ using ::bsoncxx::v_noabi::stdx::optional; } // namespace stdx } // namespace bsoncxx + +/// +/// @file +/// Provides `std::optional`-related polyfills for library API usage. +/// +/// @note The API and ABI compatibility of this polyfill is determined by polyfill build +/// configuration variables and the `BSONCXX_POLY_USE_*` macros provided by @ref +/// bsoncxx-v_noabi-bsoncxx-config-config-hpp. +/// +/// @see [Choosing a C++17 +/// Polyfill](https://www.mongodb.com/docs/languages/cpp/cpp-driver/current/polyfill-selection/) +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace v_noabi { +namespace stdx { + +/// +/// A polyfill for `std::optional`. +/// +/// @note The API and ABI compatibility of this polyfill is determined by polyfill build +/// configuration variables and the `BSONCXX_POLY_USE_*` macros provided by @ref +/// bsoncxx-v_noabi-bsoncxx-config-config-hpp. +/// +template +class optional {}; + +} // namespace stdx +} // namespace v_noabi +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/string_view.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/string_view.hpp index 424d07f346..5d8d62799f 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/string_view.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/string_view.hpp @@ -115,30 +115,22 @@ namespace bsoncxx { namespace v_noabi { namespace stdx { -/** - * @brief Implementation of std::string_view-like class template - */ template > class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail::ordering_operators { public: - // Pointer to (non-const) character type using pointer = Char*; - // Pointer to const-character type using const_pointer = const Char*; - // Type representing the size of a string using size_type = std::size_t; - // Type representing the offset within a string using difference_type = std::ptrdiff_t; - // The type of the string character using value_type = Char; - // Constant sentinel value to represent an impossible/invalid string position + // Constant sentinel value to represent an impossible/invalid string position. static constexpr size_type npos = static_cast(-1); private: - // Pointer to the beginning of the string being viewed + // Pointer to the beginning of the string being viewed. const_pointer _begin = nullptr; - // The size of the array that is being viewed via `_begin` + // The size of the array that is being viewed via `_begin`. size_type _size = 0; public: @@ -150,33 +142,15 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: using const_reverse_iterator = std::reverse_iterator; using reverse_iterator = const_reverse_iterator; - /** - * @brief Default constructor. Constructs to an empty/null string view - */ constexpr basic_string_view() noexcept = default; constexpr basic_string_view(const basic_string_view&) noexcept = default; bsoncxx_cxx14_constexpr basic_string_view& operator=(const basic_string_view&) noexcept = default; - /** - * @brief Construct a new string view from a pointer-to-character and an - * array length. - */ constexpr basic_string_view(const_pointer s, size_type count) : _begin(s), _size(count) {} - /** - * @brief Construct a new string view from a C-style null-terminated character array. - * - * The string size is inferred as-if by strlen() - */ constexpr basic_string_view(const_pointer s) : _begin(s), _size(traits_type::length(s)) {} - /** - * @brief Implicit conversion from string-like ranges. - * - * Requires that `StringLike` is a non-array contiguous range with the same - * value type as this string view, and is a std::string-like value. - */ template constexpr basic_string_view( const std::basic_string& str) noexcept @@ -187,7 +161,6 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: : _begin(sv.data()), _size(sv.size()) {} #endif - // Construction from a null pointer is deleted basic_string_view(std::nullptr_t) = delete; constexpr const_iterator begin() const noexcept { @@ -219,96 +192,59 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: return const_reverse_iterator{crbegin()}; } - /** - * @brief Access the Nth element of the referred-to string - * - * @param offset A zero-based offset within the string to access. Must be less - * than size() - */ constexpr const_reference operator[](size_type offset) const { return _begin[offset]; } - /** - * @brief Access the Nth element of the referred-to string. - * - * @param pos A zero-based offset within the string to access. If not less - * than size(), throws std::out_of_range - */ bsoncxx_cxx14_constexpr const_reference at(size_type pos) const { if (pos >= size()) { throw std::out_of_range{"bsoncxx::stdx::basic_string_view::at()"}; } return _begin[pos]; } - /// Access the first character in the string + constexpr const_reference front() const { return (*this)[0]; } - /// Access the last character in the string + constexpr const_reference back() const { return (*this)[size() - 1]; } - /// Obtain a pointer to the beginning of the referred-to character array constexpr const_pointer data() const noexcept { return _begin; } - /// Obtain the length of the referred-to string, in number of characters + constexpr size_type size() const noexcept { return _size; } - /// Obtain the length of the referred-to string, in number of characters + constexpr size_type length() const noexcept { return size(); } - /// Return `true` if size() == 0, otherwise `false` + constexpr bool empty() const noexcept { return size() == 0; } - /// Return the maximum value that could be returned by size() + constexpr size_type max_size() const noexcept { return static_cast(std::numeric_limits::max()); } - /** - * @brief In-place modify the string_view to view N fewer characters from the beginning - * - * @param n The number of characters to remove from the beginning. Must be less than size() - */ bsoncxx_cxx14_constexpr void remove_prefix(size_type n) { _begin += n; _size -= n; } - /** - * @brief In-place modify the string_view to view N fewer characters from the end - * - * @param n The number of characters to remove from the end. Must be less than size() - */ bsoncxx_cxx14_constexpr void remove_suffix(size_type n) { _size -= n; } - /** - * @brief Swap the reference with another string_view - */ bsoncxx_cxx14_constexpr void swap(basic_string_view& other) { std::swap(_begin, other._begin); std::swap(_size, other._size); } - /** - * @brief Copy the contents of the viewed string into the given output destination. - * - * @param dest The destination at which to write characters - * @param count The maximum number of characters to copy. - * @param pos The offset within the viewed string to begin copying from. - * @returns The number of characters that were copied to `dest`. The number - * of copied characters is always the lesser of `size()-pos` and `count` - * - * @throws std::out_of_range if pos > size() - */ size_type copy(pointer dest, size_type count, size_type pos = 0) const { if (pos > size()) { throw std::out_of_range{"bsoncxx::stdx::basic_string_view::substr()"}; @@ -318,15 +254,6 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: return count; } - /** - * @brief Obtain a substring of this string - * - * @param pos The zero-based index at which to start the new string. - * @param count The number of characters to include following `pos` in the new string. - * Automatically clamped to the available size - * - * @throws std::out_of_range if `pos` is greater than this->size() - */ bsoncxx_cxx14_constexpr basic_string_view substr(size_type pos = 0, size_type count = npos) const { if (pos > size()) { @@ -335,52 +262,24 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: return basic_string_view(_begin + pos, (std::min)(count, size() - pos)); } - /** - * @brief Compare two strings lexicographically - * - * @param other The "right hand" operand of the comparison - * @returns `0` If *this == other - * @returns `n : n < 0` if *this is "less than" other. - * @returns `n : n > 0` if *this is "greater than" other. - */ constexpr int compare(basic_string_view other) const noexcept { - // Another level of indirection to support restricted C++11 constexpr + // Another level of indirection to support restricted C++11 constexpr. return _compare2(Traits::compare(data(), other.data(), (std::min)(size(), other.size())), other); } - /** - * @brief Compare *this with the given C-string - * - * @returns compare(basic_string_view(cstr)) - */ constexpr int compare(const_pointer cstr) const { return compare(basic_string_view(cstr)); } - /** - * @brief Compare a substring of *this with `other` - * - * @returns substr(po1, count1).compare(other) - */ constexpr int compare(size_type pos1, size_type count1, basic_string_view other) const { return substr(pos1, count1).compare(other); } - /** - * @brief Compare a substring of *this with the given C-string - * - * @returns substr(pos1, count1, basic_string_view(cstr)) - */ constexpr int compare(size_type pos1, size_type count1, const_pointer cstr) const { return compare(pos1, count1, basic_string_view(cstr)); } - /** - * @brief Compare a substring of *this with a substring of `other` - * - * @returns substr(pos1, count1).compare(other.substr(pos2, count2)) - */ constexpr int compare(size_type pos1, size_type count1, basic_string_view other, @@ -389,11 +288,6 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: return substr(pos1, count1).compare(other.substr(pos2, count2)); } - /** - * @brief Compare a substring of *this with a string viewed through the given pointer+size - * - * @returns substr(pos1, count1).compare(basic_string_view(str, count2)) - */ constexpr int compare(size_type pos1, size_type count1, const_pointer str, @@ -401,10 +295,6 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: return substr(pos1, count1).compare(basic_string_view(str, count2)); } - /** - * @brief Find the zero-based offset of the left-most occurrence of the given infix, - * starting with pos. If infix does not occur, returns npos. - */ bsoncxx_cxx14_constexpr size_type find(basic_string_view infix, size_type pos = 0) const noexcept { if (pos > size()) { @@ -412,7 +302,7 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: } basic_string_view sub = this->substr(pos); if (infix.empty()) { - // The empty string is always "present" at the beginning of any string + // The empty string is always "present" at the beginning of any string. return pos; } const_iterator found = std::search(sub.begin(), sub.end(), infix.begin(), infix.end()); @@ -422,13 +312,9 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: return static_cast(found - begin()); } - /** - * @brief Find the zero-based offset of the right-most occurrence of the given infix, - * starting with (and including) pos. If infix does not occur, returns npos. - */ bsoncxx_cxx14_constexpr size_type rfind(basic_string_view infix, size_type pos = npos) const noexcept { - // Calc the endpos where searching should begin, which includes the infix size + // Calc the endpos where searching should begin, which includes the infix size. const size_type substr_size = pos != npos ? pos + infix.size() : pos; if (infix.empty()) { return (std::min)(pos, size()); @@ -441,34 +327,18 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: return static_cast(rend() - f) - infix.size(); } - /** - * @brief Find the zero-based index of the left-most occurrence of any character of the given - * set, starting at pos - */ constexpr size_type find_first_of(basic_string_view set, size_type pos = 0) const noexcept { return _find_if(pos, [&](value_type chr) { return set.find(chr) != npos; }); } - /** - * @brief Find the zero-based index of the right-most occurrence of any character of the - * given set, starting at (and including) pos - */ constexpr size_type find_last_of(basic_string_view set, size_type pos = npos) const noexcept { return _rfind_if(pos, [&](value_type chr) { return set.find(chr) != npos; }); } - /** - * @brief Find the zero-based index of the left-most occurrence of any character that - * is NOT a member of the given set of characters - */ constexpr size_type find_first_not_of(basic_string_view set, size_type pos = 0) const noexcept { return _find_if(pos, [&](value_type chr) { return set.find(chr) == npos; }); } - /** - * @brief Find the zero-based index of the right-most occurrence of any character that - * is NOT a member of the given set of characters, starting at (and including) pos - */ constexpr size_type find_last_not_of(basic_string_view set, size_type pos = npos) const noexcept { return _rfind_if(pos, [&](value_type chr) { return set.find(chr) == npos; }); @@ -487,6 +357,7 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: return Name(basic_string_view(cstr), pos); \ } \ BSONCXX_FORCE_SEMICOLON + DECL_FINDERS(find, 0); DECL_FINDERS(rfind, npos); DECL_FINDERS(find_first_of, 0); @@ -495,9 +366,7 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: DECL_FINDERS(find_last_not_of, npos); #pragma pop_macro("DECL_FINDERS") - /** - * @brief Explicit-conversion to a std::basic_string - */ + // Explicit-conversion to a std::basic_string. template explicit operator std::basic_string() const { return std::basic_string(data(), size()); @@ -510,20 +379,20 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: #endif private: - // Additional level-of-indirection for constexpr compare() + // Additional level-of-indirection for constexpr compare(). constexpr int _compare2(int diff, basic_string_view other) const noexcept { // "diff" is the diff according to Traits::cmp return diff ? diff : static_cast(size() - other.size()); } - // Implementation of equality comparison + // Implementation of equality comparison. constexpr friend bool tag_invoke(bsoncxx::detail::equal_to, basic_string_view left, basic_string_view right) noexcept { return left.size() == right.size() && left.compare(right) == 0; } - // Implementation of a three-way-comparison + // Implementation of a three-way-comparison. constexpr friend bsoncxx::detail::strong_ordering tag_invoke( bsoncxx::detail::compare_three_way cmp, basic_string_view left, @@ -538,7 +407,7 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: } // Find the first in-bounds index I in [pos, size()) where the given predicate - // returns true for substr(I). If no index exists, returns npos + // returns true for substr(I). If no index exists, returns npos. template bsoncxx_cxx14_constexpr size_type _find_if(size_type pos, F pred) const noexcept { const auto sub = substr(pos); @@ -566,7 +435,8 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: } }; -// Required to define this here for C++≤14 compatibility. Can be removed in C++≥17 +// Required to define this here for compatibility with C++14 and older. Can be removed in C++17 or +// newer. template const std::size_t basic_string_view::npos; @@ -604,3 +474,36 @@ using ::bsoncxx::v_noabi::stdx::string_view; } // namespace stdx } // namespace bsoncxx + +/// +/// @file +/// Provides `std::string_view`-related polyfills for library API usage. +/// +/// @note The API and ABI compatibility of this polyfill is determined by polyfill build +/// configuration variables and the `BSONCXX_POLY_USE_*` macros provided by @ref +/// bsoncxx-v_noabi-bsoncxx-config-config-hpp. +/// +/// @see [Choosing a C++17 +/// Polyfill](https://www.mongodb.com/docs/languages/cpp/cpp-driver/current/polyfill-selection/) +/// + +#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + +namespace bsoncxx { +namespace v_noabi { +namespace stdx { + +/// +/// A polyfill for `std::string_view`. +/// +/// @note The API and ABI compatibility of this polyfill is determined by polyfill build +/// configuration variables and the `BSONCXX_POLY_USE_*` macros provided by @ref +/// bsoncxx-v_noabi-bsoncxx-config-config-hpp. +/// +class string_view {}; + +} // namespace stdx +} // namespace v_noabi +} // namespace bsoncxx + +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/type_traits.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/type_traits.hpp index 503a0fdd1b..7ffb88cbc8 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/type_traits.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/type_traits.hpp @@ -22,15 +22,11 @@ namespace bsoncxx { namespace detail { -#define bsoncxx_ttparam \ - template \ - class - -/// Obtain the nested ::type of the given type argument +// Obtain the nested ::type of the given type argument template using type_t = typename T::type; -/// Obtain the value_type member type of the given argument +// Obtain the value_type member type of the given argument template using value_type_t = typename T::value_type; @@ -38,6 +34,7 @@ template using enable_if_t = typename std::enable_if::type; #pragma push_macro("DECL_ALIAS") +#undef DECL_ALIAS #define DECL_ALIAS(Name) \ template \ using Name##_t = type_t> @@ -59,63 +56,51 @@ DECL_ALIAS(add_rvalue_reference); template using common_type_t = type_t>; -/** - * @brief Remove top-level const+volatile+reference qualifiers from the given type. - */ +// Remove top-level const+volatile+reference qualifiers from the given type. template using remove_cvref_t = remove_cv_t>; -/** - * @brief Create a reference-to-const for the given type - */ +// Create a reference-to-const for the given type template using const_reference_t = add_lvalue_reference_t>; -// Workaround for CWG issue 1558 +// Workaround for CWG issue 1558. template -struct _just_void_ { +struct just_void { using type = void; }; -/** - * @brief A "do-nothing" alias template that always evaluates to void - * - * @tparam Ts Zero or more type arguments, all discarded - */ + +// A "do-nothing" alias template that always evaluates to void. +// +// @tparam Ts Zero or more type arguments, all discarded template using void_t = #if defined(_MSC_VER) && _MSC_VER < 1910 // Old MSVC requires that the type parameters actually be "used" to trigger SFINAE at caller. - // This was resolved by CWG issue 1558 - typename _just_void_::type; + // This was resolved by CWG issue 1558. + typename just_void::type; #else void; #endif -/** - * @brief Alias for integral_constant - */ +// Alias for integral_constant. template using bool_constant = std::integral_constant; -/** - * @brief Holds a list of types. - * - * This template is never defined, so cannot be used in contexts that require a complete type. - */ +// Holds a list of types. +// +// This template is never defined, so cannot be used in contexts that require a complete type. template struct mp_list; -// Like std::declval, but does not generate a hard error if used. -template -extern add_rvalue_reference_t soft_declval() noexcept; - -/// ## Implementation of the C++11 detection idiom +// Details for implementing the C++11 detection idiom. namespace impl_detection { // Implementation of detection idiom for is_detected: true case template < // A metafunction to try and apply - bsoncxx_ttparam Oper, + template + class Oper, // The arguments to be given. These are deduced from the mp_list argument typename... Args, // Apply the arguments to the metafunction. If this yields a type, this function @@ -126,7 +111,7 @@ std::true_type is_detected_f(mp_list*); // Failure case for is_detected. Because this function takes an elipsis, this is // less preferred than the above overload that accepts a pointer type directly. -template +template