explicit interface implementation

Ender KaShae astrothayne at gmail.com
Fri Jun 29 08:17:30 PDT 2007


C# made the intelligent decision to include explicit interface implementation.  This greatly reduced ambiguity in multiple implementation fo interfaces.
ex:
interface one{
int foo();
}
interface two{
double foo();
}

class c{
int foo(){return 1;}
double two.foo(){return 1.0;}
}

otherwise there would be now way to implement both methods.
if it is extended to classes then many ambiguities in multiple inheritance are solved.  For the rest it simply needs to be required that the subclass overrides the correct method when multiple superclasses have the same method signature.



More information about the Digitalmars-d mailing list