template <typename Predicate, typename Pipe = ml::ToList>
struct RemoveIdsIf {
template <typename ...Ts>
using f = /* .... */;
};
RemoveIdsIf<Predicate, Pipe>
is a metafunction that passes to Pipe
a parameter pack ml::Int
<Is>...
of indexes of the elements of the parameter pack Ts...
, for which the predicate does not hold. Pipe
defaults to ml::ToList
.
f:: Ts... -> ml::Int<Is>... >-> Pipe
Predicate must be a metafunction returning ml::Bool<truth_value>
.
f:: T -> ml::Bool<truth_value>
using T0 = ml::f<
ml::RemoveIdsIf<ml::IsClass<>>,
int, char, std::string>;
static_assert(
std::is_same_v<
T,
ml::ListT<ml::Int<0>, ml::Int<1>>>);
using T1 = ml::f<
ml::RemoveIdsIf<
ml::IsClass<ml::Not<>>>,
int, char, std::string>;
static_assert(
std::is_same_v<
T,
ml::ListT<ml::Int<2>>>);