A link can be initialized, but not assigned. Once a link is initialized, it will continue to reference the same object as long as it exists. If you do not define an assignment operator, the compiler will synthesize the one that performs the member assignment, but in this case it is impossible, therefore the compiler cannot / will not synthesize it at all.
You can define the assignment operator yourself. It is up to you to decide exactly how to deal with the member that is referencing. In most cases, you simply define your object so that it does not contain references.
When you get to it, the primary use for links is almost certainly a parameter. As members of a class, they do not make sense very often, and in the rare case that they make sense, objects of this class probably should not support the assignment.
source share