Aggregates & associations
Sean Kelly
sean at f4.ca
Wed Dec 19 16:49:05 PST 2007
Bruce Adams wrote:
> On Wed, 19 Dec 2007 20:41:58 -0000, Sean Kelly <sean at f4.ca> wrote:
>>
>> Interestingly, if objects are constructed inside the memory reserved
>> for other objects, then if one is collected by the GC it must be true
>> that all other objects in the same block are free as well. Also,
>> since they share memory, all the objects can safely refer to one
>> another in their dtors so long as they are careful to avoid using
>> member data that may already have been released. As you say, this
>> promises to offer some interesting possibilities for composite objects.
>
> Except that at present there's no way to declare that an object is
> contained in
> another object except as a struct and a struct is not an object. I don't
> think
> scope would do this and if it did it would be ahem beyond its scope to
> do so.
Why? It works this way for class variables declared elsewhere. As a
QOI feature, but still...
Sean
More information about the Digitalmars-d
mailing list