An interface limitation forces me to cast MyObject*
into a void*
using static_cast. When getting this pointer back on later interface calls, I have to perform another static_cast from void*
to MyObject*
, because dynamic_cast wouldn't work in this case (explained here).
However, I'd like to perform a type-safety check, to ensure no weird things happen if somebody else changes parts of the code. If there is any check that can be performed under this circumstands, which one would be the best/most convenient one?