Skip to content

Instantly share code, notes, and snippets.

@zakky-dev
Created December 22, 2013 10:08
Show Gist options
  • Save zakky-dev/8080538 to your computer and use it in GitHub Desktop.
Save zakky-dev/8080538 to your computer and use it in GitHub Desktop.
template mixinのテスト
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