Boost logo

Boost Users :

From: Andrew McDonald (andrew.mcdonald_at_[hidden])
Date: 2006-07-28 04:45:45


> I have a specific c++ question, and was wondering whether someone
> could offer some advice.

It is probably better to post such questions to comp.lang.c++ or comp.lang.c++.moderated

> ie is it safe to assume that Test's copy constructor will call the
> copy constructor of all the above attributes.

>From the C++ standard ISO/IEC 14882:1998(E) Section 12.8.8;

The implicitly defined copy constructor for class X performs a memberwise copy of its subobjects. The
order of copying is the same as the order of initialization of bases and members in a user defined
constructor (see 12.6.2).

Each subobject is copied in the manner appropriate to its type:

- if the subobject is of class type, the copy constructor for the class is used;
- if the subobject is an array, each element is copied, in the manner appropriate to the element type;
- if the subobject is of scalar type, the builtin assignment operator is used.

Virtual base class subobjects shall be copied only once by the implicitly defined
copy constructor (see 12.6.2).

regards,

Andrew McDonald
System Architect

Norwood Systems Australia Pty Ltd
Level 1, 71 Troy Terrace
PO Box 1281
Subiaco, WA 6904

Tel +61 8 9380 7766
Fax +61 8 9380 7733
  
The information in this email, and any attachments, may contain confidential information and is intended solely for the attention and use of the named addressee (s). It must not be disclosed to any person(s) without authorization. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are not authorized to, and must not, disclose, copy, distribute, or retain this message or any part of it. If you have received this communication in error, please notify the sender immediately.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net