_d_arrayliteralTX

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];
}
extern (C)
void*
_d_arrayliteralTX
(
const TypeInfo ti
,
size_t length
)

Parameters

ti TypeInfo

TypeInfo of resulting array type

length size_t

.length of array literal

Return Value

Type: void*

pointer to allocated array

Meta