The OpenD Programming Language

reverseArgs

N-ary predicate that reverses the order of arguments, e.g., given pred(a, b, c), returns pred(c, b, a).

template reverseArgs(alias fun)
reverseArgs
(
Args...
)
(
auto ref Args args
)
if (
is(typeof(fun(Reverse!args)))
)

Members

Functions

reverseArgs
auto ref reverseArgs(Args args)

Examples

int abc(int a, int b, int c) { return a * b + c; }
alias cba = reverseArgs!abc;
assert(abc(91, 17, 32) == cba(32, 17, 91));

Meta