new T[size] vs .reserve - alloca

Namespace rswhite4 at googlemail.com
Tue Feb 5 12:09:04 PST 2013


Why not:
[code]
T[] stack(T, const size_t N)(void* m = alloca(T.sizeof * N))
{
     return (cast(T*)m)[0 .. N];
}
[/code]
?


More information about the Digitalmars-d-learn mailing list