The OpenD Programming Language

adjoin

Takes multiple functions and adjoins them together. The result is a Tuple with one element per passed-in function. Upon invocation, the returned tuple is the adjoined results of all functions. Note: In the special case where only a single function is provided (F.length == 1), adjoin simply aliases to the single passed function (F[0]).

template adjoin(fun...)
static if(fun.length != 1)
static if(Filter!(_needNary, fun).length == 0)
adjoin
(
Args...
)
(
auto ref Args args
)
if (
fun.length &&
fun.length <= 26
)

Members

Functions

adjoin
auto adjoin(Args args)

Examples

static bool f1(int a) { return a != 0; }
static int f2(int a) { return a / 2; }
auto x = adjoin!(f1, f2)(5);
assert(is(typeof(x) == Tuple!(bool, int)));
assert(x.a == true && x.b == 2);

Meta