digitalmars.D.learn - confused about scope storage class
- Trass3r (4/4) Jul 28 2009 So scope for class references guarantees that the destructor is called
- Jarrett Billingsley (4/8) Jul 28 2009 There is none. The compiler will accept meaningless attributes. It's
- Kagamin (2/4) Jul 29 2009 It will be disastrous to automatically delete all referenced objects.
- Trass3r (1/2) Jul 29 2009 Now that you say it, yes there could be other references to that object.
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?
Jul 28 2009
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.
Jul 28 2009
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.
Jul 29 2009
It will be disastrous to automatically delete all referenced objects.Now that you say it, yes there could be other references to that object.
Jul 29 2009