Re: Destroy two assumptions: interface implementation generated by TMP

2014-08-12 Thread John Colvin via Digitalmars-d-learn
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

Re: Destroy two assumptions: interface implementation generated by TMP

2014-08-12 Thread anonymous via Digitalmars-d-learn
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; }

Re: Destroy two assumptions: interface implementation generated by TMP

2014-08-12 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 12 August 2014 at 11:34:01 UTC, anonymous wrote: 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){};

Re: Destroy two assumptions: interface implementation generated by TMP

2014-08-12 Thread anonymous via Digitalmars-d-learn
On Tuesday, 12 August 2014 at 12:08:14 UTC, John Colvin wrote: 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. The instantiations of the template are just normal functions though, no? They are not

Re: Destroy two assumptions: interface implementation generated by TMP

2014-08-12 Thread Baz via Digitalmars-d-learn
On Tuesday, 12 August 2014 at 12:43:46 UTC, anonymous wrote: On Tuesday, 12 August 2014 at 12:08:14 UTC, John Colvin wrote: 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. The instantiations of the