Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mixin Inherits( T... )
- {
- static foreach( Index, ST; T )
- {
- mixin( "ST base" ~ Index.to!string ~ ";" );
- }
- alias base0 this;
- }
- struct Object1
- {
- int foo;
- }
- struct Object3
- {
- int notFoo;
- }
- struct Object2
- {
- mixin Inherits!( Object1, Object3 );
- int bar;
- }
- pragma( msg, Object2.init.foo );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement