KUMI v5.0.0
Gorgeous Garnet
Loading...
Searching...
No Matches

Callable object partitioning a product type over a predicate. More...

Variables

template<template< typename > typename Pred>
constexpr partition_t< Pred > kumi::partition {}

Detailed Description

Callable object partitioning a product type over a predicate.

Variable Documentation

◆ partition

template<template< typename > typename Pred>
partition_t<Pred> kumi::partition {}
inlineconstexprnodiscardnoexcept

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

Header file

#include <kumi/kumi.hpp>

Call Signature

namespace kumi
{
template<template<typename> typename Pred, concepts::product_type T>
constexpr auto partition(T && t) noexcept;
}
Concept specifying a type follows the Product Type semantic.
Definition concepts.hpp:77
constexpr partition_t< Pred > partition
Definition partition.hpp:131
Main KUMI namespace.
Definition algorithm.hpp:11

Template Parameters

  • Pred: Compile-time predicate

Parameters

  • t: Product Type to process

Return value

  • A tuple containing the product type of all values whose types satisfy Pred in t and the product type of all values whose types do not satisfy Pred.

Helper type

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

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

Examples