Do array literals still always allocate?

ag0aep6g via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 14 05:07:01 PDT 2017


On 05/14/2017 02:02 PM, Eugene Wissner wrote:
> void main()
> {
>     ubyte[] arr = [ 1, 2, 3, 4, 5 ];
>
>     assert(arr == [ 1, 2, 3, 4, 5 ]);
> }
>
> Both, assignment and comparison, allocate.

Sure, but Nicholas said 1D arrays behave different from 2D arrays.


More information about the Digitalmars-d-learn mailing list