On Thu, 01 Oct 2009 12:53:46 -0500, Andrei Alexandrescu <seewebsiteforem...@erdani.org> wrote:

interface Comparator(T)
{
     int opCmp(Comparator!T rhs);
     mixin(Impl) // for each implementation Impl
     {
         int opCmp(Impl rhs);
         override int opCmp(Comparator!T rhs)
         {
             return opCmp(cast(Impl) rhs);
         }
     }
}


I like that you can use this in interfaces too. It seems to allow for something similar to multiple inheritance, but presumably without the implementation difficulty.

Phil Deets

Reply via email to