KUMI v4.0.0
Flawless Fluorite
Loading...
Searching...
No Matches

◆ filter

template<template< typename > typename Pred>
filter_t<Pred> kumi::filter {}
inlineconstexprnodiscardnoexcept

Callable object filtering a product type over a predicate.

On a record type, Pred is applied directly to the underlying elements of the fields.

Header file

#include <kumi/algorithm/partition.hpp>

Call Signature

template<product_type T>
constexpr auto filter<Pred>(T && t) noexcept;
constexpr filter_t< Pred > filter
Callable object filtering a product type over a predicate.
Definition partition.hpp:177

Template Parameters

  • Pred: Compile-time predicate

Parameters

  • t: Product Type to process

Return value

  • A Product type containing all values of t which types satisfies Pred.

Helper type

template<template<typename> typename Pred, kumi::concepts::product_type T> struct filter
{
using type = decltype(kumi::filter<Pred>(std::declval<T>()));
};
template<template<typename> typename Pred, kumi::concepts::product_type T>
using filter_t = typename kumi::result::filter<Pred, T>::type;

Computes the return type of a call to kumi::filter

Examples