Re: D's limited template specialization abilities compared to C++

2013-05-26 Thread Ahuzhgairl
Kenji, thanks again for understanding exactly what I meant. I am a big fan of template features. I seriously hope D can do this in the future- the inability of the *template system* to deduce information about non-types is one of the big holes in C++: We can deduce information at function

D's limited template specialization abilities compared to C++

2013-05-25 Thread Ahuzhgairl
Hi, In D, the : in a template parameter list only binds to 1 parameter. There is no way to specialize upon the entire template parameter list. Therefore you can't do much with the pattern matching and it's not powerful. Not a reasonable situation for a language aiming to be only the best.

Re: D's limited template specialization abilities compared to C++

2013-05-25 Thread Ahuzhgairl
By extension, template Foo[X, Y, Z @ X[Y], Y[Z]] { alias Y Foo; }

Re: D's limited template specialization abilities compared to C++

2013-05-25 Thread Ahuzhgairl
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)); }

Re: D's limited template specialization abilities compared to C++

2013-05-25 Thread Ahuzhgairl
Uneditable newsgroups. Simplest case. struct Bar(T) {} struct Foo(T : A(B), A, B) { static void f() {} } void main() { Foo!(Bar!(int)).f(); }

Re: D's limited template specialization abilities compared to C++

2013-05-25 Thread Ahuzhgairl
C++ example, works: template class struct A; template template class class X, class Y struct AXY {}; template class struct B; int main() { ABint a; } But the following does not work: struct Foo {}; template class struct B { Foo x; } template nontype P struct A; template auto M, auto

Re: D's limited template specialization abilities compared to C++

2013-05-25 Thread Ahuzhgairl
Kenji, Thank you much for the '.C' alias support, Amazed to see there could be some action so quick! Could we please look at the nontype-as-primary-template? How can we deduce all of the dependent types from a non-type template parameter, if it's the only parameter of the primary template?