Callable object partitionning a product type over a predicate.
On a record type, Pred is applied directly to the underlying elements of the fields.
#include <kumi/algorithm/partition.hpp>
template<product_type T>
constexpr partition_t< Pred > partition
Callable object partitionning a product type over a predicate.
Definition partition.hpp:115
- Pred: Compile-time predicate
- t: Product Type to process
- A tuple containing the product type of all values which types satisfies Pred in t and the product type of all values which types does not satisfy Pred.
template<
template<
typename>
typename Pred, kumi::concepts::product_type T>
struct partition
{
};
template<template<typename> typename Pred, kumi::concepts::product_type T>
using partition_t = typename kumi::result::partition<Pred, T>::type;
Computes the return type of a call to kumi::partition
#include <kumi/kumi.hpp>
#include <type_traits>
#include <iostream>
int main()
{
int a = 4;
double b = 3.1415;
float c = 0.01f;
auto original =
kumi::tuple{a,&a,b,&b,c,&c,
'z',
nullptr};
std::cout << original << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33
#include <kumi/kumi.hpp>
#include <type_traits>
#include <iostream>
int main()
{
using namespace kumi::literals;
int a = 4;
double b = 3.1415;
float c = 0.01f;
auto original =
kumi::record{
"a"_id = a,
"b"_id = &a,
"c"_id = b,
"d"_id = &b,
"e"_id = c,
"f"_id = &c,
"g"_id =
'z',
"h"_id =
nullptr};
std::cout << original << "\n";
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36