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

◆ max_flat()

template<concepts::product_type T, typename F>
auto kumi::max_flat ( T && t,
F f )
inlinenodiscardconstexprnoexcept

Computes the maximum value of applications of f to all elements of kumi::flatten_all(t).

Parameters
tTuple to inspect
fUnary Callable object
Returns
The maximum value of f over all elements of a flattened version of t

Helper type

namespace kumi
{
template<typename T, typename F> struct max_flat;
template<typename T, typename F>
using max_flat_t = typename max_flat<T, F>::type;
}
constexpr auto max_flat(T &&t, F f) noexcept
Computes the maximum value of applications of f to all elements of kumi::flatten_all(t).
Definition minmax.hpp:106
Main KUMI namespace.
Definition algorithm.hpp:11

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

Examples:

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