template <typename B, typename Pipe = ml::Identity>
struct IfElse {
template <typename T0, typename T1>
using f = /* .... */;
};
IfElse<Test>
is a metafunction that passes to U
, which is T0
if B
is ml::Bool
<true>
, and T1
if B
is ml::Bool
<false>
. Pipe
defaults to ml::Identity
.
f:: T0, T1 -> U
using U = ml::f<
IfElse<ml::Bool<true>>,
int,
char;
static_assert(
std::is_same_v<
U, int>);