I see only one reason for this: B overloaded operator*() to return X , but the one who wrote the code needed X* . (Note that there is A* in your X code.) A typical case for this is smart pointers and iterators.
If this is not the case above, perhaps the code was written as general enough to work with smart pointers / iterators. Or did he use smart pointers, and whoever changed it didn’t change &* too? Have you looked at your story when it was introduced and what then did the code look like?
source share