Template Inheritance?

Jean-Louis Leroy jl at leroy.nyc
Sun Apr 12 17:12:01 UTC 2020


Today I came across a use case for template inheritance:

   template Namespace(N)
   {
     alias functions = ...; // using getMembers and getOverloads
   }

   template Aggregate(A) : Namespace(A)
   {
     // aggregate specific stuff, e.g.:
     alias base = ...;
   }

   template Module(M) : Namespace(M)
   {
     // module specific stuff
   }

Has this ever been considered?

I used a mixin template to get the effect I want...




More information about the Digitalmars-d mailing list