how can I get a reference of array?

zhmt via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 5 02:22:33 PST 2015


On Thursday, 5 February 2015 at 10:12:47 UTC,  wrote:
> On Thursday, 5 February 2015 at 06:58:09 UTC, Ali Çehreli wrote:
>> On 02/04/2015 10:42 PM, zhmt wrote:
>>> Here is a simple code snippet:
>
> With this approach, the allocation of `arr` itself is often 
> clumsy and error-prone. In this case it is important to note 
> that `arr` is allocated on the stack and thus has scoped 
> lifetime.
>
> Consider using std.container.array.Array instead.

@Jakob Ovrum

Thx for your advice.

I am still learning dlang, I will pay attention to memory 
management in the future.


More information about the Digitalmars-d-learn mailing list