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

◆ zip_max()

template<concepts::product_type T0, concepts::product_type... Ts>
requires (concepts::follows_same_semantic<T0, Ts...>)
auto kumi::zip_max ( T0 && t0,
Ts &&... ts )
inlinenodiscardconstexpr

Constructs 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
Parameters
t0Product type to convert
tsProduct types to convert
Returns
The tuple of all combination of elements from t0,ts...
Note
zip_max fills missing elements to reach the biggest product type size.

Helper type

namespace kumi::result
{
template<product_type T> struct zip_max;
template<product_type T>
using zip_max_t = typename zip<T>::type;
}
constexpr auto zip(T0 &&t0, Ts &&... ts)
Constructs a tuple where the ith element is the product type of all ith elements of t0,...
Definition zip.hpp:97
constexpr auto zip_max(T0 &&t0, Ts &&... ts)
Constructs a tuple where the ith element is the product type of all ith elements of t0,...
Definition zip.hpp:189

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

See also
zip
zip_min

Example:

#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_max( nbrs, ltrs, ratio );
std::cout << r << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33