Destroy two assumptions: interface implementation generated by TMP

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 12 04:16:11 PDT 2014


On Monday, 11 August 2014 at 18:21:04 UTC, Baz wrote:
> Hi, I try to get why the last way of generating an interface 
> implementation fails. I've put assumptions: is it right ?
> -------------------------------
> module itfgen;
>
> import std.stdio;
>
> interface itf{
>     void a_int(int p);
>     void a_uint(uint p);
> }
>
> class impl3: itf{
>     void tmp(T)(T p){};
>     alias a_int = tmp!int;
>     alias a_uint = tmp!uint;
> }

Part of me feels that ought to work. There may well be good 
reasons why not though.

Currently you do have to have method implementations/overrides 
written out as normal functions.


More information about the Digitalmars-d-learn mailing list