Jacob Carlborg <[email protected]> wrote:
> On 2015-12-04 15:00, Andrei Alexandrescu wrote:
> 
>> How would one create a module inside a class or struct? -- Andrei
> 
> Hmm, I see that I really didn't understand what you were trying to do. 
> So you want to create a namespace inside a class or struct? I would 
> probably create a separate struct and return that from a function
> 
> struct List(T)
> {
>     static struct Stable
>     {
>         void fun(int x) { }
>     }
>     auto stable() { return Stable(); }
> }
> 
> List!(int) list;
> 
> list.stable.fun(2);
> 

Won't work. Fun has no access to the list.

Reply via email to