Callable object computing the maximum value of all elements of t.
#include <kumi/algorithm/minmax.hpp>
template<product_type T>
constexpr auto max(T && t)
noexcept;
constexpr max_t max
Callable object computing the maximum value of all elements of t.
Definition minmax.hpp:174
template<product_type T, typename Function>
constexpr auto max(T && t, Function f)
noexcept;
- t: Product Type to inspect
- f: Unary callable object to be invoked
- The maximum value of all elements of t
template<
typename T,
typename F =
void>
struct max
{
using type =
decltype(
kumi::max(std::declval<T>(), std::declval<F>()));
};
template<
typename T>
struct max<T, void>
{
using type =
decltype(
kumi::max(std::declval<T>()));
};
template<typename T, typename F = void> using max_t = typename kumi::result::max<T, F>::type;
Computes the return type of a call to kumi::max
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
std::cout <<
kumi::max(f1, [](
auto m) {
return sizeof(m); }) <<
"\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
auto f0 =
kumi::record {
"a"_id = 1,
"b"_id =
'A',
"c"_id = 99.77f,
"d"_id = 3. };
auto f1 =
kumi::record {
"a"_id = 2.,
"b"_id = f0,
"c"_id = 3.f };
std::cout <<
kumi::max(f1, [](
auto m) {
return sizeof(m); }) <<
"\n";
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36