digitalmars.D.learn - template specialization and template mixin
- Jack Applegame (31/31) May 16 2013 This code compiles , as expected
- Andrej Mitrovic (2/3) May 16 2013 I think this is a bug.
This code compiles , as expected struct A { void func(string s : "foo")() { pragma(msg, "func for foo"); } void func(string s)() { pragma(msg, "func for others: " ~ s); } } void main() { A a; a.func!"foo"(); a.func!"bar"(); } Why this doesn't compile? mixin template M() { void func(string s)() { pragma(msg, "func for others: " ~ s); } } struct A { mixin M; void func(string s : "foo")() { pragma(msg, "func for foo"); } } void main() { A a; a.func!"foo"(); a.func!"bar"(); // Error }
May 16 2013
On 5/16/13, Jack Applegame <japplegame gmail.com> wrote:Why this doesn't compile?I think this is a bug.
May 16 2013