39using is_bson_view_compatible = detail::conjunction<
40 std::is_constructible<v_noabi::types::bson_value::view, T>,
41 detail::negation<detail::disjunction<
42 detail::is_alike<T, v_noabi::types::bson_value::view>,
43 detail::is_alike<T, v_noabi::types::bson_value::value>>>>;
66#pragma push_macro("X")
68#define X(_name, _value) b_##_name _b_##_name;
86#pragma push_macro("X")
88#define X(_name, _value) \
89 case v_noabi::type::k_##_name: \
90 _b_##_name = from_v1(v.get_##_name()); \
97#pragma push_macro("X")
99#define X(_name, _value) \
100 explicit view(v_noabi::types::b_##_name v) noexcept : _id{v.type_id}, _b_##_name{v} {}
109#pragma pop_macro("X")
115#pragma push_macro("X")
117#define X(_name, _value) \
118 case v_noabi::type::k_##_name: \
119 return {to_v1(_b_##_name)};
127#pragma pop_macro("X")
148#pragma push_macro("X")
150#define X(_name, _value) BSONCXX_ABI_EXPORT_CDECL(v_noabi::types::b_##_name const&) get_##_name() const;
162#pragma pop_macro("X")
173 return !(lhs == rhs);
189detail::requires_t<bool, detail::is_bson_view_compatible<T>>
operator==(
view const& lhs, T&& rhs) {
190 return lhs ==
view{std::forward<T>(rhs)};
195detail::requires_t<bool, detail::is_bson_view_compatible<T>>
operator==(T&& lhs,
view const& rhs) {
196 return view{std::forward<T>(lhs)} == rhs;
201detail::requires_t<bool, detail::is_bson_view_compatible<T>>
operator!=(
view const& lhs, T&& rhs) {
202 return lhs !=
view{std::forward<T>(rhs)};
207detail::requires_t<bool, detail::is_bson_view_compatible<T>>
operator!=(T&& lhs,
view const& rhs) {
208 return view{std::forward<T>(lhs)} != rhs;
243using v_noabi::types::bson_value::operator==;
244using v_noabi::types::bson_value::operator!=;
#define BSONCXX_ABI_EXPORT_CDECL(...)
Equivalent to BSONCXX_ABI_EXPORT with BSONCXX_ABI_CDECL.
Definition export.hpp:52
The bsoncxx v_noabi macro guard postlude header.
The bsoncxx v_noabi macro guard prelude header.
view() noexcept
Default constructs a bson_value::view. The resulting view will be initialized to point at a bson_valu...
Definition view.hpp:80
A non-owning, read-only union of BSON type values.
Definition view.hpp:1023
A non-owning variant that can contain any BSON type.
Definition view.hpp:62
detail::requires_t< bool, detail::is_bson_view_compatible< T > > operator!=(T &&lhs, view const &rhs)
Compares a view with a type representable as a view.
Definition view.hpp:207
v_noabi::type type_id() const
Equivalent to type() const.
Definition view.hpp:144
detail::requires_t< bool, detail::is_bson_view_compatible< T > > operator!=(view const &lhs, T &&rhs)
Compares a view with a type representable as a view.
Definition view.hpp:201
friend bool operator==(view const &lhs, view const &rhs)
Compare two bson_value::views for equality.
v_noabi::type type() const
Returns the type of the underlying BSON value stored in this object.
Definition view.hpp:135
friend bool operator!=(view const &lhs, view const &rhs)
Compare two bson_value::views for equality.
Definition view.hpp:172
detail::requires_t< bool, detail::is_bson_view_compatible< T > > operator==(view const &lhs, T &&rhs)
Compares a view with a type representable as a view.
Definition view.hpp:189
view() noexcept
Default constructs a bson_value::view. The resulting view will be initialized to point at a bson_valu...
Definition view.hpp:80
view(v1::types::view const &v)
Construct with the bsoncxx::v1 equivalent.
Definition view.hpp:85
detail::requires_t< bool, detail::is_bson_view_compatible< T > > operator==(T &&lhs, view const &rhs)
Compares a view with a type representable as a view.
Definition view.hpp:195
Declares bsoncxx::v_noabi::document::element.
Declares entities representing any BSON value type.
Declares entities representing BSON value types.
Declares entities representing any BSON value type.
Declares entities representing BSON value types.
Declares entities whose ABI stability is NOT guaranteed.
type
An enumeration of each BSON type.
Definition types.hpp:47
@ k_null
Null value.
Definition types.hpp:57
v1::element::view to_v1(v_noabi::array::element const &v)
Convert to the bsoncxx::v1 equivalent of v.
Definition element.hpp:132
v_noabi::array::value from_v1(v1::array::value const &v)
Convert from the bsoncxx::v1 equivalent of v.
Definition value.hpp:267
The top-level namespace within which all bsoncxx library entities are declared.
Provides entities used to represent BSON types.
#define BSONCXX_V1_TYPES_XMACRO(X)
X-macro over the name and value of BSON types.
Definition id-fwd.hpp:44
Provides non-owning, read-only entities representing a BSON type value.
Declares bsoncxx::v_noabi::types::bson_value::value.
Declares bsoncxx::v_noabi::types::bson_value::view.