17 #include <bsoncxx/builder/basic/helpers.hpp>
18 #include <bsoncxx/builder/concatenate.hpp>
19 #include <bsoncxx/builder/core.hpp>
20 #include <bsoncxx/stdx/string_view.hpp>
22 #include <bsoncxx/config/prelude.hpp>
25 BSONCXX_INLINE_NAMESPACE_BEGIN
31 void value_append(core* core, T&& t);
45 template <
typename Arg,
typename... Args>
46 BSONCXX_INLINE
void append(Arg&& a, Args&&... args) {
47 append_(std::forward<Arg>(a));
48 append(std::forward<Args>(args)...);
61 template <
typename K,
typename V>
62 BSONCXX_INLINE
typename std::enable_if<
63 std::is_same<typename std::decay<K>::type, stdx::string_view>::value>
::type
64 append_(std::tuple<K, V>&& t) {
65 _core->
key_view(std::forward<K>(std::get<0>(t)));
66 impl::value_append(_core, std::forward<V>(std::get<1>(t)));
72 template <
typename K,
typename V>
73 BSONCXX_INLINE
typename std::enable_if<
74 std::is_same<typename std::decay<K>::type, std::string>::value>
::type
75 append_(std::tuple<K, V>&& t) {
76 _core->
key_owned(std::forward<K>(std::get<0>(t)));
77 impl::value_append(_core, std::forward<V>(std::get<1>(t)));
83 template <std::
size_t n,
typename V>
84 BSONCXX_INLINE
void append_(std::tuple<
const char (&)[n], V>&& t) {
85 _core->
key_view(stdx::string_view{std::get<0>(t), n - 1});
86 impl::value_append(_core, std::forward<V>(std::get<1>(t)));
93 void append_(concatenate_doc doc) {
102 BSONCXX_INLINE_NAMESPACE_END
105 #include <bsoncxx/config/postlude.hpp>