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

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

Variables

constexpr zip_max_t kumi::zip_max {}

Detailed Description

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

Variable Documentation

◆ zip_max

zip_max_t kumi::zip_max {}
inlineconstexprnodiscard

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
kumi::concepts::follows_same_semantic
Note
zip_max fills missing elements to reach the biggest product type size.
See also
zip
zip_min

Header file

#include <kumi/kumi.hpp>

Call Signature

namespace kumi
{
constexpr auto zip_max(T && t, Ts &&... ts);
}
Concept specifying a type follows the Product Type semantic.
Definition concepts.hpp:77
constexpr zip_max_t zip_max
Definition zip.hpp:295
Main KUMI namespace.
Definition algorithm.hpp:11

Parameters

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

Return value

  • The tuple of all combinations of elements from t, ts...

Helper type

template<kumi::concepts::product_type T0, kumi::concepts::product_type... Ts>
using zip_max_t = decltype(kumi::zip_max(kumi::declval<T0>(), kumi::declval<Ts>()...));
template<kumi::concepts::product_type T0, kumi::concepts::product_type... Ts> struct zip_max
{
using type = kumi::result::zip_max_t<T0, Ts...>;
};

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

Example

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