17 #include <bsoncxx/builder/stream/value_context-fwd.hpp>
19 #include <bsoncxx/builder/core.hpp>
20 #include <bsoncxx/builder/stream/array_context.hpp>
21 #include <bsoncxx/builder/stream/closed_context.hpp>
22 #include <bsoncxx/builder/stream/helpers.hpp>
23 #include <bsoncxx/stdx/type_traits.hpp>
25 #include <bsoncxx/config/prelude.hpp>
68 BSONCXX_INLINE detail::requires_not_t<base, detail::is_invocable<T, single_context>>
70 _core->
append(std::forward<T>(t));
82 BSONCXX_INLINE detail::requires_t<base, detail::is_invocable<T, single_context>>
84 detail::invoke(std::forward<T>(func), *
this);
93 BSONCXX_INLINE key_context<base>
operator<<(
const open_document_type) {
95 return wrap_document();
103 BSONCXX_INLINE array_context<base>
operator<<(
const open_array_type) {
113 operator single_context();
115 #if !defined(_MSC_VER) && !defined(__INTEL_COMPILER)
118 std::is_same<
value_context, decltype(std::declval<value_context>() << 1 <<
"str")>::value,
119 "value_context must be templatized on a key_context");
123 BSONCXX_INLINE base unwrap() {
127 BSONCXX_INLINE array_context<base> wrap_array() {
128 return array_context<base>(_core);
131 BSONCXX_INLINE key_context<base> wrap_document() {
132 return key_context<base>(_core);
143 #include <bsoncxx/config/postlude.hpp>
A low-level interface for constructing BSON documents and arrays.
Definition: core.hpp:45
core & append(const types::b_double &value)
Appends a BSON double.
core & open_array()
Opens a sub-array within this BSON datum.
core & open_document()
Opens a sub-document within this BSON datum.
A stream context which expects a value, which can later be followed by more key/value pairs.
Definition: value_context.hpp:50
detail::requires_not_t< base, detail::is_invocable< T, single_context > > operator<<(T &&t)
<< operator for accepting a real value and appending it to the core builder.
Definition: value_context.hpp:69
value_context(core *core)
Create a value_context given a core builder.
Definition: value_context.hpp:58
The top-level namespace for bsoncxx library entities.
Definition: element-fwd.hpp:19