Tag: virtual
3 posts
-
Missing Virtual Destructor: Why Deleting Through a Base Pointer Leaks or Worse
Why deleting via a base pointer without a virtual destructor is undefined behavior, what GCC warns about, why unique_ptr<Base> hits it but shared_ptr hides it.
-
"undefined reference to vtable": What the Linker Is Telling You and How to Fix It
Why GCC reports "undefined reference to vtable for X": the key function rule, undefined virtual destructors, unlinked .cpp files and Qt moc, and each fix.
-
C++ Inheritance Design: Access Specifiers, Virtual Destructors, Hiding and Diamonds
C++ class hierarchy design: public vs private inheritance, virtual destructors, virtual calls in constructors, name hiding, slicing and virtual bases.