Computes the minimum value of applications of f to all elements of t.
- Parameters
-
| t | Tuple to inspect |
| f | Unary Callable object |
- Returns
- The minimum value of f over all elements of t
Helper type
{
template<
typename T,
typename F>
struct min;
template<typename T, typename F>
}
constexpr auto min(T &&t) noexcept
Computes the minimum value all elements of t.
Definition minmax.hpp:156
Main KUMI namespace.
Definition algorithm.hpp:11
Computes the type returned by a call to kumi::min.
Examples:
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
std::cout <<
kumi::min(f0, [](
auto m) {
return sizeof(m); }) <<
"\n";
std::cout <<
kumi::min(f1, [](
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 = 1,
"b"_id =
'A',
"c"_id =-9.77f,
"d"_id =3. };
auto f1 =
kumi::record {
"a"_id =2.,
"b"_id =f0,
"c"_id =3.f };
std::cout <<
kumi::min(f0, [](
auto m) {
return sizeof(m); }) <<
"\n";
std::cout <<
kumi::min(f1, [](
auto m) {
return sizeof(m); }) <<
"\n";
}
Fixed-size collection of heterogeneous fields necessarily named, names are unique.
Definition record.hpp:29