Template resolution and interfaces

qznc qznc at web.de
Wed Dec 11 02:10:10 PST 2013


On Tuesday, 10 December 2013 at 17:50:45 UTC, Torje Digernes 
wrote:
> http://pastie.org/8542555
>
> Compositing an class via curry fails when I try to use 
> interfaces.
>
> Guessing that this is due to when classes are validated for
> interface implementation and when templates are instantiated.
>
> I thought this was a cool optional way to build/composite 
> classes
> instead of wrappers. Don't think it has inherent advantages
> (except that trivial wrappers look silly), just another way to 
> do
> it. Any chance I can do this anytime soon? Or already by writing
> somewhat smarter?

Your code creates an alias, which only exists at compile-time but 
not at run-time. The compiler error "interface function 'void 
mpriority()' is not implemented" is correct.

A naive implementation is straightforward:

void mpriority() { priority(myData); }

Why do you want to use curry?


More information about the Digitalmars-d-learn mailing list