Oracle® Solaris Studio 12.4: C++ User's Guide

Exit Print View

Updated: March 2015
 
 

9.4.1 Choosing to Pass Classes Directly

To maximize the chance that a class will be passed directly:

  • Use default constructors, especially the default copy constructor, where possible.

  • Use the default destructor where possible. Because the default destructor is not virtual, a class with a default destructor should generally not be a base class.

  • Avoid virtual functions and virtual bases.