The OpenD Programming Language

adjoin

Takes multiple functions and adjoins them together.

template adjoin (
F...
) if (
F.length >= 1
) {}

Parameters

F

the call-able(s) to adjoin

Return Value

A new function which returns a std.typecons.Tuple. Each of the elements of the tuple will be the return values of F.

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]).

Examples

import std.typecons : Tuple;
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[0] == true && x[1] == 2);

Meta