arrayOp

fnT[] arrayOp(T : T[], Args...)(T[] res, Filter!(isType, Args) args) @trusted

Perform array (vector) operations and store the result in res. Operand types and operations are passed as template arguments in Reverse Polish Notation (RPN).

Operands can be slices or scalar types. The element types of all slices and all scalar types must be implicitly convertible to T.

Operations are encoded as strings, e.g. `"+"`, `"%"`, `"*="`. Unary operations are prefixed with "u", e.g. "u-", "u~". Only the last operation can and must be an assignment (`"="`) or op-assignment ("op=").

All slice operands must have the same length as the result slice.

Parameters

Argsoperand types and operations in RPN
resthe slice in which to store the results
argsoperand values

Returns

the slice containing the result