Warner Losh imp at bsdimp.com wrote on Fri Jan 26 06:02:04 UTC 2018 : > It's a flaw in C++ that you have a choice here. All dtors should be > virtual because you never know when you'll have new derived classes and > have to hunt down a hard-to-find bug because you didn't go back and make it > virtual.
The "C++ Coding Standards" book described it this way: QUOTE To delete, or not to delete, that is the question: if deleting through a pointer to base Base should be allowed, then Base's destructor must be public and virtual. Otherwise, it should be protected and nonvirtual. . . . Corollary: Always write a destructor for a base class, because the implicitly generated one is public and nonvirtual. END QUOTE See page 90 for more. === Mark Millard marklmi at yahoo.com ( markmi at dsl-only.net is going away in 2018-Feb, late) _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"