itemprop="text">
How do I setup a class that represents
an interface? Is this just an abstract base class?
Answer
class
IDemo
{
public:
virtual ~IDemo()
{}
virtual void OverrideMe() = 0;
};
class
Parent
{
public:
virtual
~Parent();
};
class Child : public Parent,
public IDemo
{
public:
virtual void
OverrideMe()
{
//do stuff
}
};
You
don't have to include a body for the virtual destructor - it turns out some compilers
have trouble optimizing an empty destructor and you're better off using the default.
No comments:
Post a Comment