17 #include <bsoncxx/builder/basic/sub_array.hpp>
18 #include <bsoncxx/builder/basic/sub_document.hpp>
19 #include <bsoncxx/stdx/type_traits.hpp>
21 #include <bsoncxx/config/prelude.hpp>
30 BSONCXX_INLINE detail::requires_t<void, detail::is_invocable<T, sub_document>>
31 generic_append(core* core, T&& func) {
32 core->open_document();
33 detail::invoke(std::forward<T>(func), sub_document(core));
34 core->close_document();
37 template <
typename T,
typename Placeholder =
void>
38 BSONCXX_INLINE detail::requires_t<void, detail::is_invocable<T, sub_array>>
39 generic_append(core* core, T&& func) {
41 detail::invoke(std::forward<T>(func), sub_array(core));
45 template <
typename T,
typename =
void,
typename =
void>
46 BSONCXX_INLINE detail::requires_not_t<void,
47 detail::is_invocable<T, sub_document>,
48 detail::is_invocable<T, sub_array>>
49 generic_append(core* core, T&& t) {
50 core->append(std::forward<T>(t));
54 BSONCXX_INLINE
void value_append(core* core, T&& t) {
55 generic_append(core, std::forward<T>(t));
64 #include <bsoncxx/config/postlude.hpp>
The top-level namespace for bsoncxx library entities.
Definition: element-fwd.hpp:19