Home > Articles > Programming > C/C++

Item 9: Never call virtual functions during construction or destruction

Toggle Open Article Table of ContentsArticle Contents

Close Table of ContentsArticle Contents

  1. Item 9: Never call virtual functions during construction or destruction
Close Table of Contents
  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss
If you've come to C++ from another programming language like C# or Java, it may seem counterintuitive to avoid calling virtual functions during construction or deconstruction, but in C++, doing this will cause unexpected results and endless headaches.
View this Item in PDF format.
  • Share ThisShare This
  • Your Account

Discussions

Make a New Comment

You must log in in order to post a comment.

Related Resources

Jennifer  BortelWin FREE iPhone Developer Books and Videos- Introducing @InformIT Giveaways
By Jennifer Bortel on February 5, 2010 No Comments

Apples’s recent iPad announcement made our hearts flutter so we couldn’t resist making an announcement of our own!

Today marks the first ever @InformIT Giveaway!

We’ll regularly post a video like this one profiling spectacular prizes we’re giving away—from books and videos to T-shirts and other exciting stuff. Check out the video below to see the giveaways for today, and then scroll down for more prize details and instructions on how to win them!

Dustin Sullivan"Every OSX developer should have this book on their desk."
By Dustin Sullivan on February 1, 2010 No Comments

That was the sentence Mike Riley ended his recent Dr Dobb's CodeTalk review of Cocoa Programming Developer's Handbook with.

David ChisnallCocoa Tip of the Day, 1/29/10
By David Chisnall on January 29, 2010 No Comments

Don't ignore old versions of OS X.

See All Related Blogs

Informit Network