Template Inheritance

Gorge Jingale via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 30 20:04:27 PDT 2016


I like to build structures using template mixins because one can 
pick and choose functionality at compile time, but still have a 
relationship between different types.

It would be really nice if one could sort of test if a template 
mixin was "mixed" in(or ideally, struct S : SomeTemplate 
(template inheritance)).

While one can overcome a lot of the issues by doing static 
checking(e.g., does IsSomeTemplate compile or other introspective 
like checks), it is a bit messy and clutters up the code.

Does anyone do stuff like this and have a nice elegant way?







More information about the Digitalmars-d-learn mailing list