2013/5/25 Ahuzhgairl <bulletproofch...@gmail.com> > No, > > struct Foo(T) { > static void f() { writeln("general"); } > } > > struct Foo(T : A(B).alias C, A, B, C) { > static void f() { writeln("special"); } > } > > struct Bar(T) { > struct Baz {} > } > > struct Baz(T : A(B), A, B) { > } > > void main() { > Foo!(Bar!(int).Baz); > Baz!(Bar!(int)); > } >
As I already shown, Baz!(Bar!(int)); could work in D. But, currently Foo!(Bar!(int).Baz); is not yet supported. I'm opening a compiler enhancement for related case, http://d.puremagic.com/issues/show_bug.cgi?id=9022 and right now I updated compiler patch to allow parameterize enclosed type by name/type/alias. https://github.com/D-Programming-Language/dmd/pull/1296 https://github.com/9rnsr/dmd/commit/b29726d30b0094b9e7c2e15f5802501cb686ee68 After it is merged, you can write it as follows. import std.stdio; struct Foo(T) { static void f() { writeln("general"); } } struct Foo(T : A!(B).C, alias A, B, alias C) { static void f() { writeln("special"); } } struct Bar(T) { struct Baz {} } void main() { Foo!(Bar!(int).Baz) x; x.f(); // prints "special" } Kenji Hara