int a[10];
int b[10];
a = b;
//
struct test {
int a[10];
};
test a,b;
a = b;
First code doesn't compile, since we cant assign array, but the second does. Isn't the default assignment operator of class simply call assignment for each data members? Why does the the second code compile?
From the C++11 draft, section 12.8:
The important part here is:
if the subobject is an array, each element is assigned, in the manner appropriate to the element type;