_d_arraysetassign

fnTarr _d_arraysetassign(Tarr : T[], T)(return scope Tarr to, scope ref T value) @trusted

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

todestination array
valuethe element to set

Returns

to