check for self-assignment in operator=