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==]
Peteroid - 13 Nov 2005 14:01 GMT
I think I got it:
ref class derivedClass : public baseClass
{
protected:
virtual void VMethod( ) override {}
} ;
[==P==]
> 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:
[quoted text clipped - 18 lines]
>
> [==P==]
Carl Daniel [VC++ MVP] - 13 Nov 2005 15:39 GMT
> I think I got it:
>
[quoted text clipped - 3 lines]
> virtual void VMethod( ) override {}
> } ;
You got it.
-cd