Re: Explicit Interface Implementation

2015-02-14 Thread Ali Çehreli via Digitalmars-d-learn
On 02/14/2015 12:13 PM, Adam D. Ruppe wrote: On Saturday, 14 February 2015 at 20:08:09 UTC, Ali Çehreli wrote: int foo() { return 42; } the difference is C# also allows you to implement A.foo separately from B.foo. I don't think D allows that. Yeah, I obviously read too

Re: Explicit Interface Implementation

2015-02-14 Thread Ivan Timokhin via Digitalmars-d-learn
ref2401 wrote: > Does D provide a way for explicit interface implementation? > [C#] https://msdn.microsoft.com/en-us/library/ms173157.aspx Not exactly, but you may try something like this: interface A { void foo(); } interface B { void foo(); } class C : A { class Nest

Re: Explicit Interface Implementation

2015-02-14 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 14 February 2015 at 20:08:09 UTC, Ali Çehreli wrote: int foo() { return 42; } the difference is C# also allows you to implement A.foo separately from B.foo. I don't think D allows that. You can call a specific interface at the usage site, but implementing t

Re: Explicit Interface Implementation

2015-02-14 Thread Ali Çehreli via Digitalmars-d-learn
On 02/14/2015 09:19 AM, ref2401 wrote: Does D provide a way for explicit interface implementation? [C#] https://msdn.microsoft.com/en-us/library/ms173157.aspx Apparently, yes: interface A { int foo(); } interface B { int foo(); } class C : A, B { int foo() { return

Explicit Interface Implementation

2015-02-14 Thread ref2401 via Digitalmars-d-learn
Does D provide a way for explicit interface implementation? [C#] https://msdn.microsoft.com/en-us/library/ms173157.aspx