to_d_arraysetassign
fn
Tarr _d_arraysetassign(Tarr : T[], T)(return scope Tarr to, scope ref T value) @trustedSets 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
to | destination array |
value | the element to set |