Just a simple quick question which I couldn't find a solid answer to anywhere else. Is the default operator= just a shallow copy of all the class' members on the right hand side?
Class foo {
public:
int a, b, c;
};
foo f1, f2;
...
f1 = f2;
would be identical to:
f1.a = f2.a;
f1.b = f2.b;
f1.c = f2.c;
This seems to be true when I test it but I need to be sure I'm not missing some specific case.
Yes, it just copies the object member-wise, which can cause issues for raw pointers.