Re: mixin template question

2015-04-11 Thread Paul D Anderson via Digitalmars-d-learn
On Sunday, 12 April 2015 at 04:04:43 UTC, lobo wrote: On Sunday, 12 April 2015 at 03:51:03 UTC, Paul D Anderson wrote: I don't understand why the following code compiles and runs without an error: import std.stdio; mixin template ABC(){ int abc() { return 3; } } mixin ABC; int abc() { retu

Re: mixin template question

2015-04-11 Thread lobo via Digitalmars-d-learn
On Sunday, 12 April 2015 at 03:51:03 UTC, Paul D Anderson wrote: I don't understand why the following code compiles and runs without an error: import std.stdio; mixin template ABC(){ int abc() { return 3; } } mixin ABC; int abc() { return 4; } void main() { writefln("abc() = %s", abc())

mixin template question

2015-04-11 Thread Paul D Anderson via Digitalmars-d-learn
I don't understand why the following code compiles and runs without an error: import std.stdio; mixin template ABC(){ int abc() { return 3; } } mixin ABC; int abc() { return 4; } void main() { writefln("abc() = %s", abc()); } Doesn't the mixin ABC create a function with the same signatu