C++ Programming: Bitwise Copy

A default copy constructor does not do a Bitwise Copy under the following circumstances


  • When the class contains a member object of a class for which a copy assignment operator exists


  • When the class is derived from a base class for which a copy assignment operator exists

  • When the class declares one or more virtual functions (we must not copy the vptr address of the right-hand class object, since it might be a derived class object)


  • When the class inherits from a virtual base class (this is independent of whether a copy operator exists for the base class)



Labels:

Posted by - at 4:39 am | 0 comments read on

Archives

  • May 2011
  • February 2009
  • December 2008
  • November 2008
  • October 2008
  • August 2008
  • April 2008
  • December 2007
  • November 2007
  • January 2007
  • December 2006
  • October 2006
  • September 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005

Links