Thread overview | ||||||
---|---|---|---|---|---|---|
|
July 29, 2009 confused about scope storage class | ||||
---|---|---|---|---|
| ||||
So scope for class references guarantees that the destructor is called upon leaving the scope (why isn't this done automatically?). But what if scope is used with basic types like scope int x; What's the effect? |
July 29, 2009 Re: confused about scope storage class | ||||
---|---|---|---|---|
| ||||
Posted in reply to Trass3r | On Tue, Jul 28, 2009 at 10:46 PM, Trass3r<mrmocool@gmx.de> wrote: > So scope for class references guarantees that the destructor is called upon leaving the scope (why isn't this done automatically?). Why isn't what done automatically? > But what if scope is used with basic types like scope int x; What's the effect? There is none. The compiler will accept meaningless attributes. It's a point of contention. |
July 29, 2009 Re: confused about scope storage class | ||||
---|---|---|---|---|
| ||||
Posted in reply to Trass3r | Trass3r Wrote:
> So scope for class references guarantees that the destructor is called upon leaving the scope (why isn't this done automatically?).
It will be disastrous to automatically delete all referenced objects.
|
Copyright © 1999-2021 by the D Language Foundation