class A
{};
class B : virtual public A
{};
class C : public B
{};
main()
{
A *foo = new C;
// do stuff
delete foo;
}
I am getting a debug assert when I delete foo. Can anyone explain why this would be happening?
Also, while reading about virtual base classes I have seen examples that look like this:
class foo : virtual public bar
{};
and some that look like this:
class foo : public virtual bar
{};
Is this just a matter of style preference, or is there a functional difference between "virtual public" and "public virtual"?