Callable object computing the maximum value of applications of f to all elements of kumi::flatten_all(t).
Callable object computing the minimum value of applications of f to all elements of kumi::flatten_all(t).
Callable object computing the minimum value of all elements of t.
#include <kumi/algorithm/minmax.hpp>
template<product_type T, typename Function>
constexpr auto max_flat(T && t, Function f) noexcept;
- t: Product Type to inspect
- f: Unary callable object to be invoked
- The minimum value of f over all elements of a flattened version of t
template<
typename T,
typename F>
struct max_flat
{
using type = decltype(kumi::max_flat(std::declval<T>(), std::declval<F>()));
};
template<typename T, typename F> using max_flat_t = typename kumi::result::max_flat<T, F>::type;
Computes the return type of a call to kumi::max_flat
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
std::cout << kumi::max_flat (f0 , [](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;
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 tagged fields, tags are unique.
Definition record.hpp:36
#include <kumi/algorithm/minmax.hpp>
template<product_type T>
constexpr auto min(T && t)
noexcept;
constexpr min_t min
Callable object computing the maximum value of applications of f to all elements of kumi::flatten_all...
Definition minmax.hpp:279
template<product_type T, typename Function>
constexpr auto min(T && t, Function f)
noexcept;
- t: Product Type to inspect
- f: Unary callable object to be invoked
- The minimum value of all elements of t
template<
typename T,
typename F =
void>
struct min
{
using type =
decltype(
kumi::min(std::declval<T>(), std::declval<F>()));
};
template<
typename T>
struct min<T, void>
{
using type =
decltype(
kumi::min(std::declval<T>()));
};
template<typename T, typename F = void> using min_t = typename kumi::result::min<T, F>::type;
Computes the return type of a call to kumi::min
#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";
}
#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";
}
#include <kumi/algorithm/minmax.hpp>
template<product_type T, typename Function>
constexpr auto min_flat(T && t, Function f) noexcept;
- t: Product Type to inspect
- f: Unary callable object to be invoked
- The minimum value of f over all elements of a flattened version of t
template<
typename T,
typename F>
struct min_flat
{
using type = decltype(kumi::min_flat(std::declval<T>(), std::declval<F>()));
};
template<typename T, typename F> using min_flat_t = typename kumi::result::min_flat<T, F>::type;
Computes the return type of a call to kumi::min_flat
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
std::cout << kumi::min_flat (f0 , [](auto m) { return sizeof(m); }) << "\n";
}
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
kumi::record {
"c"_id =1.,
"d"_id =
'u',
"e"_id =3. },
"f"_id =3.f };
std::cout << kumi::min_flat (f0 , [](auto m) { return sizeof(m); }) << "\n";
}