kumi v3.1.0
Exquisite Epidote
 
Loading...
Searching...
No Matches

◆ filter_not()

template<template< typename > typename Pred, product_type T>
constexpr auto kumi::filter_not ( T &&  t)
inlineconstexprnoexcept

Filters a product type over a predicate.

Template Parameters
PredCompile-time predicate
Parameters
tProduct type to process
Returns
A product type containing all values which types does not satisfy Pred.

Helper type

namespace kumi
{
template<template<typename> typename Pred, kumi::product_type T> struct filter_not;
template<template<typename> typename Pred, kumi::product_type T>
using filter_not_t = typename filter_not<Pred, T>::type;
}
Concept specifying a type follows the Product Type semantic.
Definition concepts.hpp:33
constexpr auto filter_not(T &&t) noexcept
Filters a product type over a predicate.
Definition partition.hpp:140
Main KUMI namespace.
Definition algorithm.hpp:11

Computes the type returned by a call to kumi::filter_not.

Example:

#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";
std::cout << "Non Pointers : " << kumi::filter_not<std::is_pointer>(original) << "\n";
std::cout << "Non Reals : " << kumi::filter_not<std::is_floating_point>(original) << "\n";
std::cout << "Non nullptr : " << kumi::filter_not<std::is_null_pointer>(original) << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:37
#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"_f=a,"b"_f=&a,"c"_f=b,"d"_f=&b,"e"_f=c,"f"_f=&c,"g"_f='z',"h"_f=nullptr};
std::cout << original << "\n";
std::cout << "Non Pointers : " << kumi::filter_not<std::is_pointer>(original) << "\n";
std::cout << "Non Reals : " << kumi::filter_not<std::is_floating_point>(original) << "\n";
std::cout << "Non nullptr : " << kumi::filter_not<std::is_null_pointer>(original) << "\n";
}
Fixed-size collection of heterogeneous fields necessarily named, names are unique.
Definition traits.hpp:366