Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Beyarz
Created April 7, 2021 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Beyarz/56f18f949eb2545df6fe378bcee47a37 to your computer and use it in GitHub Desktop.
Save Beyarz/56f18f949eb2545df6fe378bcee47a37 to your computer and use it in GitHub Desktop.
mixin.d
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