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

Callable object computing the maximum value of applications of f to all elements of kumi::flatten_all(t). More...

Variables

constexpr max_flat_t kumi::max_flat {}

Detailed Description

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

Variable Documentation

◆ max_flat

max_flat_t kumi::max_flat {}
inlineconstexprnodiscardnoexcept

Header file

#include <kumi/kumi.hpp>

Call Signature

namespace kumi
{
template<concepts::product_type T, typename Function>
constexpr auto max_flat(T && t, Function f) noexcept;
}
constexpr max_flat_t max_flat
Definition minmax.hpp:245
Main KUMI namespace.
Definition algorithm.hpp:11

Parameters

  • t: Product Type to inspect
  • f: Unary callable object to be invoked

Return value

  • The minimum value of f over all elements of a flattened version of t

Helper type

//
template<typename T, typename F>
using max_flat_t = decltype(kumi::max_flat(kumi::declval<T>(), kumi::declval<F>()));
template<typename T, typename F> struct max_flat
{
using type = kumi::result::max_flat_t<T, F>;
};

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

Examples

  • Tuple
    #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:35
  • Record
    #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 with distinct labels.
    Definition record.hpp:36