[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Copying and Constructing Class Objects

(ARM, §12.1, §12.8) The compiler does not generate a copy constructor or a default operator= for a simple class. A simple class is a class that:
class Simple { int f; };
void simpleFunc (Simple s1)
{
Simple s2 = Simple(s1); // ERROR: An explicit copy constructor
// call. The compiler generates no
// default copy constructor.
Simple s3 = s1; // OK: The compiler performs a bitwise copy
}
The compiler does not guarantee that generated assignment or copy constructors will assign or initialize objects representing virtual base classes only once.
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 17, 2000