Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import std.stdio;
- mixin template Foo(string text) {
- void bar(string name) {
- writeln(text ~ " " ~ name);
- }
- }
- class Bat {
- mixin Foo!("Hello");
- }
- void main(string[] args) {
- auto bat = new Bat;
- bat.bar("there."); // Hello there.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement