template <typename Compare, typename Pipe = ml::Identity>
struct MaxElement {
template <typename ...Ts>
using f = /* .... */;
};
MaxElement<Compare, Pipe>
is a metafunction that passes to Pipe
the element U
of the parameter pack Ts...
which is maximal, given the Compare
metafunction. Pipe
defaults to ml::Identity
.
f:: Ts... -> U >-> Pipe
Compare must be a metafunction acting on two types and returning ml::Bool<truth_value>
.
f:: (T, U) -> ml::Bool<truth_value>
using T0 = ml::f<
ml::MaxElement<
ml::Map<
ml::AlignOf<>,
ml::Greater<>>>,
int, double, char>;
static_assert(
std::is_same_v<
T, double>);
NOTE that
ml::Map<
ml::AlignOf<>, // maps each element by taking its aligment
ml::Greater<>> // and pipes the resulting parameter pack into greater
is a metafunction of type
(T, U) -> (AlignOf(T), AligmentOf(U)) >-> Greater