Chapter 8

More on Classes

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • What a destructor is and when and why you need to define it
  • How to implement a destructor
  • How to create class data members in the free store and how to delete them
  • When you must write a copy constructor for a class
  • What a union is and how it can be used
  • How to make class objects work with operators such as + or *
  • How to use rvalue reference parameters to avoid unnecessary copying of class objects
  • What class templates are and how you define and use them
  • What perfect forwarding is and how you can achieve it
  • How to use the standard string class for string operations

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER

You can find the wrox.com code downloads for this chapter on the Download Code tab at www.wrox.com/remtitle.cgi?isbn=9781118368084. The code is in the Chapter 8 download and individually named according to the names throughout the chapter.

Get Ivor Horton's Beginning Visual C++ 2012 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.