Delay allocating class instance in stack.

ANtlord via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 22 01:57:34 PDT 2017


On Wednesday, 22 March 2017 at 06:47:26 UTC, Ali Çehreli wrote:
> On 03/21/2017 09:57 PM, ANtlord wrote:
> > Thank you for clarification. But I have one more question. Do
> I have to
> > use destroy for deallocating object from stack?
>
> Yes because what is going out of scope are two things:
>
> - A buffer
> - A MyClass reference
>

Oh I got it. I have to use `destroy` in this case. If I use 
`scope` I haven't buffer and MyClass reference then I can don't 
use `destroy`. Do I understand correctly?



More information about the Digitalmars-d-learn mailing list