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

◆ all_unique()

template<concepts::product_type T>
auto kumi::all_unique ( T && t)
inlinenodiscardconstexpr

Return the product type containing the values of the first occurence of each type in the input product type.

Parameters
tProduct type to process
Returns
A product type built by keeping the first occurrence of every distinct element type in the input product type.

Helper type

namespace kumi
{
template<product_type T> struct all_unique;
template<product_type T>
using all_unique_t = typename all_unique<T>::type;
}
constexpr auto all_unique(T &&t)
Return the product type containing the values of the first occurence of each type in the input produc...
Definition unique.hpp:125
Main KUMI namespace.
Definition algorithm.hpp:11

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

Examples:

#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
tuple a = {1, 2, 'x', 3, 1.f, 2.f};
std::cout << kumi::all_unique(a) << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:29
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
auto r = kumi::record{"a"_id = 1, "b"_id = 2, "c"_id = 'x', "d"_id = 3, "e"_id = 1.f, "f"_id = 2.f};
std::cout << kumi::all_unique(r) << "\n";
}
Fixed-size collection of heterogeneous fields necessarily named, names are unique.
Definition record.hpp:29