Mega Code Archive

 
Categories / Visual C++ .NET / Class
 

Interface name collision

#include "stdafx.h" using namespace System; interface class MyInterface1 { void f(); }; interface class MyInterface2 { void f(); }; ref class MyClass : MyInterface1, MyInterface2 {    public:    virtual void f()    { Console::WriteLine("MyClass::f"); } }; int main() {    MyClass^ r = gcnew MyClass();    r->f();  // MyClass::f() implements both MyInterface1's f and MyInterface2's f }