Created
April 7, 2021 16:26
-
-
Save Beyarz/56f18f949eb2545df6fe378bcee47a37 to your computer and use it in GitHub Desktop.
mixin.d
This file contains 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() | |
{ | |
int x = 5; | |
} | |
struct Bar | |
{ | |
mixin Foo; | |
} | |
void main() | |
{ | |
Bar b; | |
writeln(b.x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment