Callable object checking if a unary predicate p returns true for any element of t.
On a record type, the function operates on the underlying elements of the fields.
#include <kumi/algorithm/predicates.hpp>
template<product_type T, typename Pred>
constexpr auto any_of(T && t, Pred p)
noexcept;
constexpr any_of_t any_of
Callable object checking if a unary predicate p returns true for any element of t.
Definition predicates.hpp:207
template<product_type T, typename Pred>
constexpr auto any_of(T && t)
noexcept;
- t: Product Type to process
- p: Unary predicate
- The evaluation of p(get<0>(t)) || ... || p(get<N-1>(t)) where N is the size of t.
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
std::cout << std::boolalpha <<
kumi::any_of( t, [](
auto e) {
return e == 2; }) <<
"\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
std::cout << std::boolalpha <<
kumi::any_of( r, [](
auto e) {
return e == 2; }) <<
"\n";
auto u =
kumi::record{
"a"_id =
true,
"b"_id =
false,
"c"_id =
true,
"d"_id =
false};
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36