17 #include <mangrove/config/prelude.hpp> 22 #include <type_traits> 24 #include <bsoncxx/types.hpp> 26 #include <mangrove/expression_syntax.hpp> 27 #include <mangrove/macros.hpp> 28 #include <mangrove/util.hpp> 31 MANGROVE_INLINE_NAMESPACE_BEGIN
33 template <
typename NvpT,
typename T>
46 template <
typename Base,
typename T>
51 using no_opt_type = remove_optional_t<T>;
58 constexpr
nvp(T Base::*t,
const char* name) : t(t), name(name) {
65 return {*
this, val,
"$set"};
72 template <
typename U = no_opt_type>
82 template <
typename U = no_opt_type>
83 constexpr std::enable_if_t<std::is_same<bsoncxx::types::b_timestamp, U>::value,
86 return {*
this,
false};
97 std::string& append_name(std::string& s)
const {
98 return s.append(name);
114 template <
typename Base,
typename T,
typename Parent>
119 using no_opt_type = remove_optional_t<T>;
121 constexpr
nvp_child(T Base::*t,
const char* name,
const Parent& parent)
122 : t(t), name(name), parent(parent) {
129 return {*
this, val,
"$set"};
136 template <
typename U = no_opt_type>
139 return {*
this,
true};
146 template <
typename U = no_opt_type>
147 constexpr std::enable_if_t<std::is_same<bsoncxx::types::b_timestamp, U>::value,
150 return {*
this,
false};
159 return append_name(s);
167 return parent.append_name(s).append(1,
'.').append(name);
172 const Parent& parent;
175 template <
typename NvpT>
177 :
public nvp_base<array_element_nvp<NvpT>, iterable_value_t<typename NvpT::no_opt_type>> {
179 using type = iterable_value_t<typename NvpT::no_opt_type>;
181 using no_opt_type = remove_optional_t<type>;
190 const no_opt_type& val)
const {
191 return {*
this, val,
"$set"};
200 return append_name(s);
209 return _nvp.append_name(s).append(1,
'.').append(std::to_string(_i));
214 const std::size_t _i;
223 template <
typename T>
227 using no_opt_type = remove_optional_t<T>;
231 std::string& append_name(std::string& s)
const {
236 template <
typename NvpT>
239 template <
typename T>
242 template <
typename T>
248 template <
typename NvpT>
251 using type = iterable_value_t<typename NvpT::no_opt_type>;
253 using no_opt_type = remove_optional_t<type>;
262 const no_opt_type& val)
const {
263 return {*
this, val,
"$set"};
272 return append_name(s);
280 return _nvp.append_name(s).append(1,
'.').append(1,
'$');
294 template <
typename NvpT,
typename T>
300 template <
typename Iterable,
typename Default =
void>
301 using enable_if_matching_iterable_t =
302 std::enable_if_t<is_iterable_not_string_v<Iterable> &&
303 std::is_convertible<iterable_value_t<Iterable>,
304 iterable_value_t<remove_optional_t<T>>>::value,
310 using no_opt_type = remove_optional_t<T>;
311 using child_base_type = iterable_value_t<no_opt_type>;
323 template <
typename U>
325 const nvp<iterable_value_t<no_opt_type>, U>& child)
const {
326 return {child.t, child.name, *
static_cast<const NvpT*
>(
this)};
329 template <
typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_not_
string_v<U>>>
331 return {*
static_cast<const NvpT*
>(
this), i};
341 return {*
static_cast<const NvpT*
>(
this), ascending};
350 template <
typename Iterable,
typename = enable_if_matching_iterable_t<Iterable>>
352 return {*
static_cast<const NvpT*
>(
this), iter,
"$in"};
361 template <
typename Iterable,
typename = enable_if_matching_iterable_t<Iterable>>
363 return {*
static_cast<const NvpT*
>(
this), iter,
"$nin"};
373 template <
typename U = T,
typename = std::enable_if_t<is_optional_v<U>>>
375 return {*
static_cast<const NvpT*
>(
this), exists,
"$exists"};
385 template <typename U = no_opt_type, typename = std::enable_if_t<std::is_arithmetic<U>::value>>
387 return {*
static_cast<const NvpT*
>(
this), divisor, remainder};
396 template <
typename U = no_opt_type,
typename = std::enable_if_t<is_
string_v<U>>>
398 const char* regex,
const char* options)
const {
399 return {*
static_cast<const NvpT*
>(
this), bsoncxx::types::b_regex(regex, options),
"$regex"};
411 template <
typename Iterable,
typename = enable_if_matching_iterable_t<Iterable>,
412 typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_not_
string_v<U>>>
414 return {*
static_cast<const NvpT*
>(
this), iter,
"$all"};
427 template <
typename Expr,
typename = std::enable_if_t<details::is_query_expression_v<Expr>>,
428 typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_v<U>>>
430 return {*
static_cast<const NvpT*
>(
this), queries,
"$elemMatch"};
438 template <
typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_not_
string_v<U>>>
448 template <
typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_not_
string_v<U>>>
450 return {*
static_cast<const NvpT*
>(
this), n,
"$size"};
461 template <
typename U = no_opt_type,
462 typename = std::enable_if_t<std::is_integral<U>::value ||
463 std::is_same<U, bsoncxx::types::b_binary>::value>,
465 typename = std::enable_if_t<std::is_integral<Mask>::value ||
466 std::is_same<Mask, bsoncxx::types::b_binary>::value>>
468 return {*
static_cast<const NvpT*
>(
this), bitmask,
"$bitsAllSet"};
480 template <
typename U = no_opt_type,
481 typename = std::enable_if_t<std::is_integral<U>::value ||
482 std::is_same<U, bsoncxx::types::b_binary>::value>,
486 Args... positions)
const {
487 return {*
static_cast<const NvpT*
>(
this), bit_positions_to_mask(pos1, pos2, positions...),
497 template <
typename U = no_opt_type,
498 typename = std::enable_if_t<std::is_integral<U>::value ||
499 std::is_same<U, bsoncxx::types::b_binary>::value>,
501 typename = std::enable_if_t<std::is_integral<Mask>::value ||
502 std::is_same<Mask, bsoncxx::types::b_binary>::value>>
504 return {*
static_cast<const NvpT*
>(
this), bitmask,
"$bitsAnySet"};
516 template <
typename U = no_opt_type,
517 typename = std::enable_if_t<std::is_integral<U>::value ||
518 std::is_same<U, bsoncxx::types::b_binary>::value>,
522 Args... positions)
const {
523 return {*
static_cast<const NvpT*
>(
this), bit_positions_to_mask(pos1, pos2, positions...),
534 template <
typename U = no_opt_type,
535 typename = std::enable_if_t<std::is_integral<U>::value ||
536 std::is_same<U, bsoncxx::types::b_binary>::value>,
538 typename = std::enable_if_t<std::is_integral<Mask>::value ||
539 std::is_same<Mask, bsoncxx::types::b_binary>::value>>
541 return {*
static_cast<const NvpT*
>(
this), bitmask,
"$bitsAllClear"};
553 template <
typename U = no_opt_type,
554 typename = std::enable_if_t<std::is_integral<U>::value ||
555 std::is_same<U, bsoncxx::types::b_binary>::value>,
559 Args... positions)
const {
560 return {*
static_cast<const NvpT*
>(
this), bit_positions_to_mask(pos1, pos2, positions...),
571 template <
typename U = no_opt_type,
572 typename = std::enable_if_t<std::is_integral<U>::value ||
573 std::is_same<U, bsoncxx::types::b_binary>::value>,
575 typename = std::enable_if_t<std::is_integral<Mask>::value ||
576 std::is_same<Mask, bsoncxx::types::b_binary>::value>>
578 return {*
static_cast<const NvpT*
>(
this), bitmask,
"$bitsAnyClear"};
590 template <
typename U = no_opt_type,
591 typename = std::enable_if_t<std::is_integral<U>::value ||
592 std::is_same<U, bsoncxx::types::b_binary>::value>,
596 Args... positions)
const {
597 return {*
static_cast<const NvpT*
>(
this), bit_positions_to_mask(pos1, pos2, positions...),
602 return {*
static_cast<const NvpT*
>(
this), val,
"$setOnInsert"};
611 template <
typename U = T,
typename = std::enable_if_t<is_optional_v<U>>>
613 return {*
static_cast<const NvpT*
>(
this)};
623 return {*
static_cast<const NvpT*
>(
this), val,
"$min"};
633 return {*
static_cast<const NvpT*
>(
this), val,
"$max"};
643 template <
typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_not_
string_v<U>>>
645 return {*
static_cast<const NvpT*
>(
this)};
654 template <
typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_not_
string_v<U>>>
656 return {*
static_cast<const NvpT*
>(
this), last ? 1 : -1,
"$pop"};
665 template <
typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_not_
string_v<U>>>
667 const iterable_value_t<no_opt_type>& val)
const {
668 return {*
static_cast<const NvpT*
>(
this), val,
"$pull"};
678 template <
typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_not_
string_v<U>>,
681 const Expr& expr)
const {
682 return {*
static_cast<const NvpT*
>(
this), expr,
"$pull"};
691 template <
typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_not_
string_v<U>>,
692 typename Iterable,
typename = enable_if_matching_iterable_t<Iterable>>
694 return {*
static_cast<const NvpT*
>(
this), iter,
"$pullAll"};
703 template <
typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_not_
string_v<U>>>
705 const iterable_value_t<no_opt_type>& val)
const {
706 return {*
static_cast<const NvpT*
>(
this), val,
false};
715 template <
typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_not_
string_v<U>>,
716 typename Iterable,
typename = enable_if_matching_iterable_t<Iterable>>
718 return {*
static_cast<const NvpT*
>(
this), iter,
true};
726 template <
typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_not_
string_v<U>>>
728 const iterable_value_t<no_opt_type>& val)
const {
729 return {*
static_cast<const NvpT*
>(
this), val,
false};
745 template <
typename U = no_opt_type,
typename = std::enable_if_t<is_iterable_not_
string_v<U>>,
746 typename Iterable,
typename = enable_if_matching_iterable_t<Iterable>,
748 typename = std::enable_if_t<details::is_sort_expression_v<Sort> ||
749 std::is_same<
int, Sort>::value>>
751 const Iterable& iter, bsoncxx::stdx::optional<std::int32_t> slice = bsoncxx::stdx::nullopt,
752 const bsoncxx::stdx::optional<Sort>& sort = bsoncxx::stdx::nullopt,
753 bsoncxx::stdx::optional<std::uint32_t> position = bsoncxx::stdx::nullopt)
const {
754 return {*
static_cast<const NvpT*
>(
this), iter,
true, slice, sort, position};
764 struct is_nvp :
public std::false_type {};
766 template <
typename Base,
typename T>
769 template <
typename Base,
typename T,
typename Parent>
772 template <
typename T>
775 template <
typename NvpT>
778 template <
typename T>
782 template <
typename Base,
typename T>
783 nvp<Base, T> constexpr make_nvp(T Base::*t,
const char* name) {
791 template <
typename Base,
typename T,
typename Parent>
793 const Parent& parent) {
802 template <
typename Base,
typename T,
size_t N,
size_t M,
bool = (N < M)>
803 struct hasField : public std::false_type {};
808 template <
typename Base,
typename T,
size_t N,
size_t M>
810 :
public std::is_same<T Base::*, decltype(std::get<N>(Base::mangrove_mapped_fields()).t)> {};
818 template <
typename Base,
typename T,
size_t N,
size_t M, T Base::*t>
819 constexpr std::enable_if_t < N<M && !hasField<Base, T, N, M>::value,
bool> wrapbool();
821 template <
typename Base,
typename T,
size_t N,
size_t M, T Base::*>
822 constexpr std::enable_if_t<N == M, bool> wrapbool();
824 template <
typename Base,
typename T,
size_t N,
size_t M, T Base::*t>
825 constexpr std::enable_if_t < N<M && hasField<Base, T, N, M>::value,
bool> wrapbool() {
826 if (std::get<N>(Base::mangrove_mapped_fields()).t == t) {
829 return wrapbool<Base, T, N + 1, M, t>();
833 template <
typename Base,
typename T,
size_t N,
size_t M, T Base::*t>
834 constexpr std::enable_if_t < N<M && !hasField<Base, T, N, M>::value,
bool> wrapbool() {
835 return wrapbool<Base, T, N + 1, M, t>();
838 template <
typename Base,
typename T,
size_t N,
size_t M, T Base::*>
839 constexpr std::enable_if_t<N == M, bool> wrapbool() {
850 template <
typename Base,
typename T,
size_t N,
size_t M>
851 constexpr std::enable_if_t<N == M, const nvp<Base, T>> wrapimpl(T Base::*t);
853 template <
typename Base,
typename T,
size_t N,
size_t M>
854 constexpr std::enable_if_t<(N < M) && !hasField<Base, T, N, M>::value,
const nvp<Base, T>> wrapimpl(
859 template <
typename Base,
typename T,
size_t N,
size_t M>
860 constexpr std::enable_if_t<(N < M) && hasField<Base, T, N, M>::value,
const nvp<Base, T>> wrapimpl(
862 if (std::get<N>(Base::mangrove_mapped_fields()).t == t) {
863 return std::get<N>(Base::mangrove_mapped_fields());
865 return wrapimpl<Base, T, N + 1, M>(t);
870 template <
typename Base,
typename T,
size_t N,
size_t M>
871 constexpr std::enable_if_t<(N < M) && !hasField<Base, T, N, M>::value,
const nvp<Base, T>> wrapimpl(
873 return wrapimpl<Base, T, N + 1, M>(t);
877 template <
typename Base,
typename T,
size_t N,
size_t M>
878 constexpr std::enable_if_t<N == M, const nvp<Base, T>> wrapimpl(T Base::*) {
889 template <
typename Base,
typename T>
891 return wrapimpl<Base, T, 0, std::tuple_size<decltype(Base::mangrove_mapped_fields())>::value>(
900 template <
typename T, T,
typename =
void>
901 struct hasCallIfFieldIsPresent {};
903 template <
typename Base,
typename T, T Base::*ptr>
904 struct hasCallIfFieldIsPresent<
906 std::enable_if_t<wrapbool<
907 Base, T, 0, std::tuple_size<decltype(Base::mangrove_mapped_fields())>::value, ptr>()>> {
913 MANGROVE_INLINE_NAMESPACE_END
916 #include <mangrove/config/postlude.hpp> Represents an array update epression that uses the $push operator.
Definition: expression_syntax.hpp:89
constexpr add_to_set_update_expr< NvpT, Iterable > add_to_set(const Iterable &iter) const
Creates an update expression with the $addToSet operator and the $each modifier, that adds a list of ...
Definition: nvp.hpp:717
std::string get_name() const
Returns the qualified name of this field in dot notation, i.e.
Definition: nvp.hpp:270
Creates an expression that uses the $currentDate operator.
Definition: expression_syntax.hpp:83
constexpr add_to_set_update_expr< NvpT, iterable_value_t< no_opt_type > > add_to_set(const iterable_value_t< no_opt_type > &val) const
Creates an update expression with the $addToSet operator, that adds a single value to an array...
Definition: nvp.hpp:704
constexpr std::enable_if_t< is_date_v< U >, current_date_expr< nvp > > operator=(const current_date_t &) const
Creates an expression that sets a date value to the current date.
Definition: nvp.hpp:73
constexpr update_expr< NvpT, no_opt_type > max(const no_opt_type &val) const
Creates an expression that uses the $max operator to only update a field if the new value is greater ...
Definition: nvp.hpp:632
An object that represents a name-value pair of a member in an object.
Definition: nvp.hpp:47
constexpr sort_expr< NvpT > sort(bool ascending) const
Creates a sort expression that sorts documents by this field.
Definition: nvp.hpp:340
constexpr std::enable_if_t< details::is_query_expression_v< Expr >, update_expr< NvpT, Expr > > pull(const Expr &expr) const
Creates an update expression with the $pull operator, that removes an element if it matches the given...
Definition: nvp.hpp:680
constexpr nvp_child< iterable_value_t< no_opt_type >, U, NvpT > operator->*(const nvp< iterable_value_t< no_opt_type >, U > &child) const
Chains two name-value pairs to access a sub-field, i.e.
Definition: nvp.hpp:324
constexpr comparison_value_expr< NvpT, std::int64_t > bits_any_set(std::int64_t pos1, std::int64_t pos2, Args...positions) const
Creates a query that uses the $bitsAnySet operator to check a series of bits, given as bit positions...
Definition: nvp.hpp:520
This class represents a query expression using the $mod operator, that checks the modulus of a certai...
Definition: expression_syntax.hpp:60
constexpr update_expr< NvpT, no_opt_type > min(const no_opt_type &val) const
Creates an expression that uses the $min operator to only update a field if the new value is lower th...
Definition: nvp.hpp:622
constexpr update_value_expr< NvpT, int > pop(bool last) const
Creates an update expression with the $pop operator.
Definition: nvp.hpp:655
constexpr mod_expr< NvpT > mod(const int &divisor, const int &remainder) const
Creates a mod_expr that represents a query with the $mod operator.
Definition: nvp.hpp:386
A CRTP base class that contains member functions for name-value pairs.
Definition: nvp.hpp:34
constexpr update_expr< nvp< Base, T >, no_opt_type > operator=(const no_opt_type &val) const
Creates an update expression that sets the field to the given value.
Definition: nvp.hpp:64
std::string get_name() const
Returns the qualified name of this field in dot notation, i.e.
Definition: nvp.hpp:198
constexpr comparison_expr< NvpT, Iterable > nin(const Iterable &iter) const
Creates an expression that checks whether the value of this field matches none of the values in the g...
Definition: nvp.hpp:362
constexpr update_expr< NvpT, iterable_value_t< no_opt_type > > pull(const iterable_value_t< no_opt_type > &val) const
Creates an update expression with the $pull operator, that removes an element if it matches the given...
Definition: nvp.hpp:666
std::string & append_name(std::string &s) const
Returns the qualified name of this field in dot notation, i.e.
Definition: nvp.hpp:208
constexpr comparison_expr< NvpT, Mask > bits_any_clear(const Mask &bitmask) const
Creates a query that uses the $bitsAnyClear operator to check a numerical field with a bitmask...
Definition: nvp.hpp:577
std::string & append_name(std::string &s) const
Returns the name of this field with the $ operator, i.e.
Definition: nvp.hpp:279
An expression that uses the $addToSet operator to add unique elements to an array.
Definition: expression_syntax.hpp:86
constexpr comparison_value_expr< NvpT, bsoncxx::types::b_regex > regex(const char *regex, const char *options) const
Creates a comparison expression that represents a query with a $regex operator.
Definition: nvp.hpp:397
constexpr comparison_value_expr< NvpT, std::int64_t > bits_any_clear(std::int64_t pos1, std::int64_t pos2, Args...positions) const
Creates a query that uses the $bitsAnyClear operator to check a series of bits, given as bit position...
Definition: nvp.hpp:594
Represents an expresion that uses the $unset operator.
Definition: expression_syntax.hpp:80
constexpr comparison_expr< NvpT, Mask > bits_any_set(const Mask &bitmask) const
Creates a query that uses the $bitsAnySet operator to check a numerical field with a bitmask...
Definition: nvp.hpp:503
constexpr unset_expr< NvpT > unset() const
Creates an expression that unsets the current field.
Definition: nvp.hpp:612
Represents an update operator that modifies a certain elements.
Definition: expression_syntax.hpp:74
Represents a field that does not have a name, i.e.
Definition: nvp.hpp:224
constexpr comparison_value_expr< NvpT, std::int64_t > bits_all_set(std::int64_t pos1, std::int64_t pos2, Args...positions) const
Creates a query that uses the $bitsAllSet operator to check a series of bits, given as bit positions...
Definition: nvp.hpp:484
Represents the $ operator applied to a field.
Definition: nvp.hpp:249
Definition: collection_wrapper.hpp:28
Class that represents a name-value pair for a field of an object that is a member of another object...
Definition: nvp.hpp:115
constexpr std::enable_if_t< is_date_v< U >, current_date_expr< nvp_child > > operator=(const current_date_t &) const
Creates an expression that sets a date value to the current date.
Definition: nvp.hpp:137
constexpr comparison_expr< NvpT, bool > exists(const bool &exists) const
Creates an expression that checks the existence of a certain field.
Definition: nvp.hpp:374
constexpr update_expr< NvpT, Iterable > pull_all(const Iterable &iter) const
Creates an update expression with the $pull operator, that removes an element if it matches the given...
Definition: nvp.hpp:693
std::string get_name() const
Returns the name of this field, in dot notation.
Definition: nvp.hpp:157
Represents a comparison expression as above, but stores a value instead of a reference.
Definition: expression_syntax.hpp:57
constexpr comparison_expr< NvpT, Expr > elem_match(const Expr &queries) const
Creates a query with the $elemMatch operator that finds elements in this field that match the given q...
Definition: nvp.hpp:429
A type trait struct that inherits from std::true_type if the given type parameter is a name-value pai...
Definition: nvp.hpp:764
constexpr push_update_expr< NvpT, iterable_value_t< no_opt_type > > push(const iterable_value_t< no_opt_type > &val) const
Creates an update epxression with the $push operator, that adds a single value to an array...
Definition: nvp.hpp:727
std::string & append_name(std::string &s) const
Returns the qualified name of this field in dot notation, i.e.
Definition: nvp.hpp:166
constexpr update_expr< dollar_operator_nvp< NvpT >, no_opt_type > operator=(const no_opt_type &val) const
Creates an update expression that sets the field to the given value.
Definition: nvp.hpp:261
constexpr comparison_value_expr< NvpT, Mask > bits_all_clear(const Mask &bitmask) const
Creates a query that uses the $bitsAllClear operator to check a numerical field with a bitmask...
Definition: nvp.hpp:540
constexpr std::enable_if_t< std::is_same< bsoncxx::types::b_timestamp, U >::value, current_date_expr< nvp > > operator=(const current_date_t &) const
Creates an expression that sets a date value to the current date.
Definition: nvp.hpp:85
constexpr std::enable_if_t< std::is_same< bsoncxx::types::b_timestamp, U >::value, current_date_expr< nvp_child > > operator=(const current_date_t &) const
Creates an expression that sets a date value to the current date.
Definition: nvp.hpp:149
constexpr comparison_expr< NvpT, Iterable > in(const Iterable &iter) const
Creates an expression that checks whether the value of this field matches any value in the given iter...
Definition: nvp.hpp:351
constexpr comparison_expr< NvpT, Iterable > all(const Iterable &iter) const
Creates a query with the $all operator that compares values in this field's array to values in anothe...
Definition: nvp.hpp:413
constexpr update_expr< nvp_child< Base, T, Parent >, T > operator=(const no_opt_type &val) const
Creates an update expression that sets the field to the given value.
Definition: nvp.hpp:128
Definition: expression_syntax.hpp:77
constexpr comparison_expr< NvpT, std::int64_t > size(const std::int64_t &n) const
Creates an array query expression with the $size operator.
Definition: nvp.hpp:449
An expression that represents a sorting order.
Definition: expression_syntax.hpp:48
constexpr push_update_expr< NvpT, Iterable, Sort > push(const Iterable &iter, bsoncxx::stdx::optional< std::int32_t > slice=bsoncxx::stdx::nullopt, const bsoncxx::stdx::optional< Sort > &sort=bsoncxx::stdx::nullopt, bsoncxx::stdx::optional< std::uint32_t > position=bsoncxx::stdx::nullopt) const
Creates an update epxression with the $push operator and the $each modifier, that adds a list of valu...
Definition: nvp.hpp:750
Represents a query expression with the syntax "key: {$op: value}".
Definition: expression_syntax.hpp:54
constexpr comparison_value_expr< NvpT, std::int64_t > bits_all_clear(std::int64_t pos1, std::int64_t pos2, Args...positions) const
Creates a query that uses the $bitsAllClear operator to check a series of bits, given as bit position...
Definition: nvp.hpp:557
constexpr dollar_operator_nvp< NvpT > first_match() const
Returns a name-value pair with the $ operator appended to it.
Definition: nvp.hpp:644
constexpr update_expr< array_element_nvp< NvpT >, no_opt_type > operator=(const no_opt_type &val) const
Creates an update expression that sets the field to the given value.
Definition: nvp.hpp:189
constexpr nvp(T Base::*t, const char *name)
Create a name-value pair from a member pointer and a name.
Definition: nvp.hpp:58
std::string get_name() const
Returns the name of this field.
Definition: nvp.hpp:93
constexpr free_nvp< iterable_value_t< no_opt_type > > element() const
Constructs a nameless name-value-pair that corresponds to an element in a scalar array, if this field is an array.
Definition: nvp.hpp:439
constexpr comparison_expr< NvpT, Mask > bits_all_set(const Mask &bitmask) const
Creates a query that uses the $bitsAllSet operator to check a numerical field with a bitmask...
Definition: nvp.hpp:467