_d_arrayliteralTX

fnvoid * _d_arrayliteralTX(T)(size_t length) @trusted pure nothrow

Allocate an array literal

Rely on the caller to do the initialization of the array.

int[] getArr()
{
   return [10, 20];
   // auto res = cast(int*) _d_arrayliteralTX(typeid(int[]), 2);
   // res[0] = 10;
   // res[1] = 20;
   // return res[0..2];
}

Parameters

Tunqualified type of array elements
length.length of array literal

Returns

pointer to allocated array