If I have a class with an array as a member:
class A
{
Object array[SIZE];
};
And I copy an instance of it:
A a;
A b = a;
A c;
c = a;
will array be memcpy-ed byte-by-byte or Object::operator= copied element-by-element?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Arrays in C++ are well behaved for all first class objects, including user defined types (no matter whether they are POD/non-trivially constructible).
Output (see also http://liveworkspace.org/code/40380f1617699ae6967f0107bf080026):