core.internal.array.operations

This module contains support array (vector) operations

Types 6

aliastoElementType(E : E[]) = E

converts slice types to their element type, preserves anything else

aliastoElementType(S) = S
aliastoElementType(alias op) = op
aliastoVecType(E : E[]) = vec!E

converts slice types to their element type, preserves anything else

aliastoVecType(S) = vec!S
aliastoVecType(alias op) = op

Functions 6

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).
fnbool isUnaryOp(scope string op) pure nothrow @safe @nogc
fnbool isBinaryOp(scope string op) pure nothrow @safe @nogc
fnbool isBinaryAssignOp(string op)
fnstring toString(size_t num)
fnbool contains(T)(const scope T[] ary, const scope T[] vals...)

Templates 4

tmpltypeCheck(bool fail, T, Args...)

Check whether operations on operand types are supported. This template recursively reduces the expression tree and determines intermediate types. Type checking is done here rather than in the compiler to provide more detailed error messages.

Parameters

failwhether to fail (static assert) with a human-friendly error message
Ttype of result
Argsoperand types and operations in RPN

Returns

The resulting type of the expression

See Also

tmpltypeCheck(bool fail, T, ResultType)

ditto

tmplnot(alias tmlp)
tmplstaticIndexOf(alias pred, haystack...)

Find element in haystack for which pred is true.

Parameters

predthe template predicate
haystackelements to search

Returns

The first index for which pred!haystack[index] is true or -1.