pure virtual functions and /clr

  • Thread starter Thread starter Peteroid
  • Start date Start date
P

Peteroid

I'm trying to create an abstract base class with a pure virtual method
(using /clr and VS C++.NET 2005 Express). This will do the trick:

ref class baseClass
{
protected:
virtual void VMethod( ) abstract ; // i've tried '= 0' syntax too, no
luck
} ;

But, whenI try to create a child class, I can't figure out how to define the
virtual method to satisfy the compiler. That is, this doesn't work:

ref derivedClass : public baseClass
{
protected:
virtual void VMethod( ) {} // error
} ;

How do I do this correctly?

[==P==]
 
I think I got it:

ref class derivedClass : public baseClass
{
protected:
virtual void VMethod( ) override {}
} ;

[==P==]
 
Back
Top