Can someone please explain this to me
dynamic_cast( &(*similarObject) );
What is the point of doing the address of
It may be that the type of similarObject has overloaded operator* and so it returns something whose address you're passing to dynamic_cast.
&(*x) and x may not be always the same thing. For example, think of iterator:
std::map::iterator it = v.begin();
Then it and &(*it) are two different thing:
it is std::map::iterator &(*it) is std::pair* They're not at all same. Similar thing may happen with your code-snippet as well.