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

◆ zip_min

zip_min_t kumi::zip_min {}
inlineconstexprnodiscard

Callable object constructing a tuple where the ith element is the product type of all ith elements of t0,ts...

On record types, this function operates on elements as if they were ordered. The considered order is the order of declaration.

Note
This function does not take part in overload resolution if the product types do not follow the same semantic.
See also
follows_same_semantic
Note
zip_min truncates product types based on the smallest size.
See also
zip
zip_max

Header file

#include <kumi/algorithm/zip.hpp>

Call Signature

template<product_type T, product_type... Ts>
constexpr auto zip_min(T && t, Ts &&... ts);
constexpr zip_min_t zip_min
Callable object constructing a tuple where the ith element is the product type of all ith elements of...
Definition zip.hpp:203

Parameters

  • t: Product type to convert
  • ts: Product types to convert

Return value

  • The tuple of all combination of elements from t0, ts...

Helper type

template<kumi::concepts::product_type T0, kumi::concepts::product_type... Ts> struct zip_min
{
using type = decltype(kumi::zip_min(std::declval<T0>(), std::declval<Ts>()...));
};
template<kumi::concepts::product_type T0, kumi::concepts::product_type... Ts>
using zip_min_t = typename kumi::result::zip_min<T0, Ts...>::type;

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

Examples

Tuple

#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
auto nbrs = kumi::tuple{1,2,3,4,5,6};
auto ltrs = kumi::tuple{'a','b','c'};
auto ratio = kumi::tuple{0.1,0.01,0.001,0.0001};
auto r = kumi::zip_min( nbrs, ltrs, ratio );
std::cout << r << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33

Record

#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
auto nbrs = kumi::record{"a"_id = 1,"b"_id = 2,"c"_id = 3,"d"_id = 4,"e"_id = 5,"f"_id = 6};
auto ltrs = kumi::record{"aa"_id = 'a',"bb"_id = 'b',"cc"_id = 'c'};
auto ratio = kumi::record{"aaa"_id = 0.1,"bbb"_id = 0.01,"ccc"_id = 0.001,"ddd"_id = 0.0001};
auto r = kumi::zip_min( nbrs, ltrs, ratio );
std::cout << r << "\n";
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36