RE: Segfault with delete[] operator & virtually derived classes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lyle,

>am I lying to the compiler? That's what inheritance and polymorphism is all about!

In what way do you have a polymorphic ARRAY?

In what way does your ARRAY use inheritance?

You have an array of polymorphic objects.  The ARRAY is not polymorphic.

Use std::vector<A*> to create an array of polymorphic objects. (Use BOOST if you want managed pointers too.)

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux