Is this a valid way to create an assignment operator with members that are references?
#include
struct A
{
int &ref;
A(int &Ref)
What you do its technically correct as far as I know, but it generates trouble. For instance, consider what happens with a derived class from A, since its assignment operator generates a new object (slicing). Can't you just turn the reference into a pointer within your class?
Besides that, copy constructors and assignment operators usually take its argument by const&.