How to move append to an array?

Stanislav Blinov via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon May 15 18:34:50 PDT 2017


On Tuesday, 16 May 2017 at 01:22:49 UTC, Yuxuan Shui wrote:

> Can I expand an array with uninitialized object? Or can I rely 
> on the compiler to optimize the initialization away?

Built-in arrays always default-initialize their elements. If you 
need something that unsafe, there's std.array.uninitializedArray:

http://dlang.org/phobos/std_array.html#uninitializedArray

What are you trying to achieve?


More information about the Digitalmars-d-learn mailing list