Mega Code Archive

 
Categories / Visual C++ .NET / Class
 

Private interface

#include "stdafx.h" interface class IInterface {    void f();    int g(); }; ref class MyClass : IInterface {       virtual void f() sealed = IInterface::f       { }    public:       virtual int g() { return 1; } }; int main() {    MyClass^ r = gcnew MyClass();    IInterface^ ir = r;    ir->f();  // f may be called through the interface.    r->g();     // OK }