Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mixin Inherits( T... )
- {
- alias BaseTypes = Alias!T;
- static foreach( Index, ST; T )
- {
- mixin( "ST base" ~ Index.to!string ~ ";" );
- }
- alias base0 this;
- }
- template IsInheriting( Base, T )
- {
- static if( is( T.BaseTypes ) )
- {
- bool Inherits()
- {
- bool inherits = is( T == Base );
- static foreach( ST; T.BaseTypes )
- {
- inherits |= IsInheriting!( Base, ST );
- }
- return inherits;
- }
- enum IsInheriting = Inherits();
- }
- else
- {
- enum IsInheriting = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement