Destroy two assumptions: interface implementation generated by TMP

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 12 04:34:00 PDT 2014


On Monday, 11 August 2014 at 18:21:04 UTC, Baz wrote:
> interface itf{
>     void a_int(int p);
>     void a_uint(uint p);
> }
[...]
> // FAILS because: alias are probably generated after the itf 
> check
> class impl3: itf{
>     void tmp(T)(T p){};
>     alias a_int = tmp!int;
>     alias a_uint = tmp!uint;
> }
[...]
> 'Error: class itfgen.impl3 interface function 'void a_int(int 
> p)' is not implemented'.

I think the problem is that impl3.tmp is not virtual because it's
a template, and interfaces need to be implemented by virtual
methods.


More information about the Digitalmars-d-learn mailing list