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")
102#define X(_name, _value) \
103 explicit view(v_noabi::types::b_##_name v) noexcept : _id{v.type_id}, _b_##_name{from_v1(to_v1(v))} {}
112#pragma pop_macro("X")
118#pragma push_macro("X")
120#define X(_name, _value) \
121 case v_noabi::type::k_##_name: \
122 return {to_v1(_b_##_name)};
130#pragma pop_macro("X")
151#pragma push_macro("X")
153#define X(_name, _value) BSONCXX_ABI_EXPORT_CDECL_UNSTABLE(v_noabi::types::b_##_name const&) get_##_name() const;
165#pragma pop_macro("X")
176 return !(lhs == rhs);
192detail::requires_t<bool, detail::is_bson_view_compatible<T>>
operator==(
view const& lhs, T&& rhs) {
193 return lhs ==
view{std::forward<T>(rhs)};
198detail::requires_t<bool, detail::is_bson_view_compatible<T>>
operator==(T&& lhs,
view const& rhs) {
199 return view{std::forward<T>(lhs)} == rhs;
204detail::requires_t<bool, detail::is_bson_view_compatible<T>>
operator!=(
view const& lhs, T&& rhs) {
205 return lhs !=
view{std::forward<T>(rhs)};
210detail::requires_t<bool, detail::is_bson_view_compatible<T>>
operator!=(T&& lhs,
view const& rhs) {
211 return view{std::forward<T>(lhs)} != rhs;
246using v_noabi::types::bson_value::operator==;
247using v_noabi::types::bson_value::operator!=;
#define BSONCXX_ABI_EXPORT_CDECL_UNSTABLE(...)
Equivalent to BSONCXX_ABI_EXPORT_UNSTABLE with BSONCXX_ABI_CDECL.
Definition config.hpp:28
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:979
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:210
v_noabi::type type_id() const
Equivalent to type() const.
Definition view.hpp:147
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:204
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:138
friend bool operator!=(view const &lhs, view const &rhs)
Compare two bson_value::views for equality.
Definition view.hpp:175
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:192
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:198
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:263
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.