Created
December 22, 2013 10:08
-
-
Save zakky-dev/8080538 to your computer and use it in GitHub Desktop.
template mixinのテスト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
mixin template Foo() { | |
void show() { | |
this.member.writeln; | |
} | |
} | |
class Bar { | |
mixin Foo; | |
private int member; | |
this(int mem) { | |
this.member = mem; | |
} | |
} | |
void main() { | |
auto b = new Bar(123); | |
b.show; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment