An example of typeclasses/traits/protocols/concepts in D with interfaces

Adam D. Ruppe destructionator at gmail.com
Wed Dec 23 14:23:34 UTC 2020


On Wednesday, 23 December 2020 at 14:20:39 UTC, sighoya wrote:
> 1.) Can't we import aliases from other modules or am I just too 
> dumb to see how?

plain import includes aliases....

> 2.) it would be nice to unscope the methods of a type

that's what the `with` keyword does

T square(T, alias Implementor...) {
    with(Implementor) {
          // here
    }
}



More information about the Digitalmars-d mailing list