Getting the superclass of a type?

pineapple via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 5 09:47:12 PDT 2016


On Monday, 5 September 2016 at 15:43:52 UTC, Lodovico Giaretta 
wrote:
> On Monday, 5 September 2016 at 15:20:10 UTC, pineapple wrote:
>> I'd like to be able to write something like this, but I 
>> haven't been able to find anything in the docs
>>
>>     class Base{}
>>     class Sub: Base{}
>>     static assert(is(SuperClassOf!Sub == Base));
>
> https://dlang.org/phobos/std_traits.html#.BaseClassesTuple

Aha, thank you!


More information about the Digitalmars-d-learn mailing list