template <typename ...Fs, typename Pipe>
struct Product {
template <typename ...Ts>
using f = /* .... */;
};
Product<Fs..., Pipe>
is a metafunction that passes to Pipe
the parameter pack Us...
, which is generated by invoking each F
in the parameter pack Fs...
on the entire parameter pack Ts...
.
f:: Ts... -> Fs(Ts...)... >-> Pipe
The parameter pack of the Product<Args...>
will be treated as Pipe
, and must always be provided (there is no default).
The ml::Partition
can be implemented a Product
of ml::Filter
and ml::RemoveIf
, that Pipe
s to ml::ToList
.
template <typename Predicate>
using Partition = ml::Product<
ml::Filter<Predicate>,
ml::RemoveIf<Predicate>,
ml::ToList>;
using T = ml::f<
Partition<ml::IsClass<>>,
int, std::string, char>;
static_assert(
std::is_same_v<
T,
ml::ListT<
ml::ListT<std::string>,
ml::ListT<int, char>>>);