core.internal.array.operations

This module contains support array (vector) operations

Types 6

private aliastoElementType(E : E[]) = E

converts slice types to their element type, preserves anything else

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

converts slice types to their element type, preserves anything else

private aliastoVecType(S) = vec!S
private 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).
private fnbool isUnaryOp(scope string op) pure nothrow @safe @nogc
private fnbool isBinaryOp(scope string op) pure nothrow @safe @nogc
private fnbool isBinaryAssignOp(string op)
private fnstring toString(size_t num)
private 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.