Callable object counting the number of elements of t satisfying predicates p.
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 count_if(T && t, Pred p)
noexcept;
constexpr count_if_t count_if
Callable object counting the number of elements of t satisfying predicates p.
Definition predicates.hpp:302
- t: Product Type to process
- p: Unary predicate
- Number of elements satisfying the condition.
#include <kumi/kumi.hpp>
#include <iostream>
#include <type_traits>
int main()
{
std::cout << std::boolalpha
}
constexpr auto predicate() noexcept
Convert a unary template meta-program in a running predicate.
Definition ct_helpers.hpp:148
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33
#include <kumi/kumi.hpp>
#include <iostream>
#include <type_traits>
int main()
{
using namespace kumi::literals;
auto r =
kumi::record{
"a"_id = 1,
"b"_id = 2.,
"c"_id = 3.f,
"d"_id =
'z'};
std::cout << std::boolalpha
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36