Loading [MathJax]/extensions/tex2jax.js
kumi v3.1.0
Exquisite Epidote
 
All Classes Namespaces Functions Variables Friends Modules Pages Concepts
Loading...
Searching...
No Matches

◆ min_flat()

template<typename T , typename F >
constexpr auto kumi::min_flat ( T const t,
F  f 
)
constexprnoexcept

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

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

Helper type

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

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

Example:

#include <kumi/tuple.hpp>
#include <iostream>
int main()
{
auto f0 = kumi::tuple {2., kumi::tuple {1., 'u', 3. }, 3.f };
std::cout << kumi::min_flat (f0 , [](auto m) { return sizeof(m); }) << "\n";
}
constexpr auto from_tuple(tuple< Ts... > const &t)
Converts a kumi::tuple to an instance of an arbitrary type.
Definition convert.hpp:59
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:35