to_d_arrayctor
Tarr _d_arrayctor(Tarr : T[], T)(return scope Tarr to, scope Tarr from, char * makeWeaklyPure = null) @trustedDoes array initialization (not assignment) from another array of the same element type.
Parameters
to | what array to initialize |
from | what data the array should be initialized with |
makeWeaklyPure | unused; its purpose is to prevent the function from becoming strongly pure and risk being optimised out |
Returns
Bugs
purity, and throwabilty checks. To prevent breaking existing code, this function template is temporarily declared @trusted until the implementation can be brought up to modern D expectations.
The third parameter is never used, but is necessary in order for the function be treated as weakly pure, instead of strongly pure. This is needed because constructions such as the one below can be ignored by the compiler if _d_arrayctor is believed to be pure, because purity would mean the call to _d_arrayctor has no effects (no side effects and the return value is ignored), despite it actually modifying the contents of a. const S[2] b; const S[2] a = b; // this would get lowered to _d_arrayctor(a, b)