Topic: bitwise copy?
Author: clamage@Eng.sun.com (Steve Clamage)
Date: 1996/06/19 Raw View
In article 6wG@online.tmx.com.au, tony@online.tmx.com.au (Tony Cook) writes:
>I've seen mentions several times in this group that the implicitly
>defined copy constructor and assignment operator for PODs will
>perform a bitwise copy, but I can't find any language in the WP to
>confirm this.
>
>Is this meant to be implied by the current wording in [class.copy],
>or is it explicitly stated somewhere?
"Bitwise copy" was a term used in the ARM, and is a convenient
shorthand. It is not precise.
The implicitly-defined copy constructor (assignment operator) will
perform a memberwise copy (assignment) for any class type. If the
member has scalar type, the built-in assignment operator is used
for both operations.
The question sometimes arises whether padding bits in a POD-struct
or POD-union are guaranteed to be copied (assigned). The answer is no,
padding bits might but might not be copied (assigned). The DWP makes no
requirement either way.
---
Steve Clamage, stephen.clamage@eng.sun.com
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Author: tony@online.tmx.com.au (Tony Cook)
Date: 1996/06/19 Raw View
I've seen mentions several times in this group that the implicitly
defined copy constructor and assignment operator for PODs will
perform a bitwise copy, but I can't find any language in the WP to
confirm this.
Is this meant to be implied by the current wording in [class.copy],
or is it explicitly stated somewhere?
--
Tony Cook - tony@online.tmx.com.au
100237.3425@compuserve.com
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]