Once Again, Feature Request: Nested classes in separate scope

downs default_357-line at yahoo.de
Tue Nov 6 03:00:28 PST 2007


Regan Heath wrote:
> I'm not sure I understand the "seperate scope" requirement, what's wrong
> with:
> 
> --[windowmanager.d]--
[snip]
> --[windowmanager_main.d]--
> module windowmanager_main;
> import windowmanager;
> 
> void main()
> {
>     auto m = new WindowManager();
>     auto w1 = m.createWindow();
>     auto w2 = m.createWindow();
>     auto w3 = m.new Window();  //this is not accessible
> }
> 

That becomes a problem when you'd like to support many different types
of windows and, well, don't want them _all in one file_.

> Is the problem that you need to allow users to derive custom window
> types from Window?

Well, that too :p

> I'm not sure if it's possible to derive from an
> inner class or what the syntax would be if it was...
> 

I don't see why it shouldn't be, theoretically. Though I also don't know
what the syntax is (or would be). It doesn't seem to be possible at all
right now.

> Regan

--downs



More information about the Digitalmars-d mailing list