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
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;
}
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){};
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
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