Once Again, Feature Request: Nested classes in separate scope

downs default_357-line at yahoo.de
Tue Nov 6 02:15:34 PST 2007


Vladimir Panteleev wrote:
> On Tue, 06 Nov 2007 12:11:04 +0200, downs <default_357-line at yahoo.de> wrote:
> 
>> Vladimir Panteleev wrote:
>>> I think this could be done with the announced "alias foo this;" syntax.
>>> (just declare a Foo in Bar and import its namespace)
>>>
>> Yes, but part of the point of the whole thing was to avoid declaring a
>> Foo in Bar, because that implies a circular ownership relation.
>>  --downs
> 
> Why do you call it a "circular relation"? Foo's declaration or implementation is still Bar-free.
> And technically speaking, this is done in the same way - a nested class's "parent" class is nothing but a hidden member.
> 

See the example. I need a Foo that owns many Bar's, but each Bar can
also access all methods of Foo - the idea is that the Bars can only
exist in the _context_ of a Foo, which is I think what inner classes
were supposed to do. Sorry if I'm misunderstanding it.
 --downs :)



More information about the Digitalmars-d mailing list