On Sat, 27 Feb 2016 13:35:30 +0000, Iakh wrote: > There was discussion and proposal to extend D with static inheritance: > http://forum.dlang.org/thread/jwzxngccuwwizyivp...@forum.dlang.org > > But it could be done just with mixins, UDAs and some rewriting of > predicates. > > Exaple: > > @concept!isInputRange() > struct Range { > mixin checkConcepts; > > int front() > { > return 0; > } > }
Looks good. I'd prefer to have just the mixin or just the attribute -- the latter being tricky just now. It'd be just as easy to make it: struct Range { mixin ensureConcept!isInputRange; }