Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
core.internal.array.arrayassign
- @trusted Tarr
_d_arrayassign_l(Tarr : T[], T)(return scope Tarrto, scope Tarrfrom); - Does array assignment (not construction) from another array of the same element type. Handles overlapping copies. Assumes the right hand side is an lvalue,Used for static array assignment with non-POD element types:
struct S { ~this() {} // destructor, so not Plain Old Data } void main() { S[3] arr; S[3] lvalue; arr = lvalue; // Generates: // _d_arrayassign_l(arr[], lvalue[]), arr; }
Parameters:Tarr todestination array Tarr fromsource array Returns:to - @trusted Tarr
_d_arrayassign_r(Tarr : T[], T)(return scope Tarrto, scope Tarrfrom); - Does array assignment (not construction) from another array of the same element type. Does not support overlapping copies. Assumes the right hand side is an rvalue,Used for static array assignment with non-POD element types:
struct S { ~this() {} // destructor, so not Plain Old Data } void main() { S[3] arr; S[3] getRvalue() {return lvalue;} arr = getRvalue(); // Generates: // (__appendtmp = getRvalue), _d_arrayassign_l(arr[], __appendtmp), arr; }
Parameters:Tarr todestination array Tarr fromsource array Returns:to - @trusted Tarr
_d_arraysetassign(Tarr : T[], T)(return scope Tarrto, ref scope Tvalue); - Sets all elements of an array to a single value. Takes into account postblits, copy constructors and destructors. For Plain Old Data elements,rt/memset.d is used.
struct S { ~this() {} // destructor, so not Plain Old Data } void main() { S[3] arr; S value; arr = value; // Generates: // _d_arraysetassign(arr[], value), arr; }
Parameters:Tarr todestination array T valuethe element to set Returns:to
Copyright © 1999-2026 by the D Language Foundation | Page generated by
Ddoc on Wed Aug 5 15:47:53 2026