_d_arrayliteralTX
fn
void * _d_arrayliteralTX(T)(size_t length) @trusted pure nothrowAllocate 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
T | unqualified type of array elements |
length | .length of array literal |
Returns
pointer to allocated array