Map
Index
Random
Help
th

Quote: a copy constructor initializes an object by copying another object; used for initialization, argument passing, and function return

topics > all references > references sa-sz > QuoteRef: stroB_1991 , p. 238



Topic:
initialization of data
Topic:
replacement as setting a reference to a value
Topic:
finalization of data

Quotation Skeleton

[A] user-defined assignment operator is not applied to … [(e.g., the object could contain a random pointer)]. … Consequently, a similar, but separate, function must be … [p. 239] For a type X, the copy constructor … be overemphasized that assignment and initialization are different … destructor that performs a nontrivial task, such as … avoiding memberwise copying of objects … There are two more cases when an object … passed, a hitherto uninitialized variable -- the formal … The same is the case for function return … In both cases, the copy constructor will be …   Google-1   Google-2

Copyright clearance needed for quotation.

Additional Titles

Quote: assignment and initialization are different operations; assignment only applies to properly constructed objects
Quote: classes with nontrivial destructors need to define an assignment operator and copy constructor

Related Topics up

Topic: initialization of data (42 items)
Topic: replacement as setting a reference to a value (10 items)
Topic: finalization of data (10 items)

Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.