I saw the code line by line
ASSERT(static_cast<MyClass*>(p) == reinterpret_cast<MyClass*>(p))
I think p was a pointer to the base type. What is the purpose of this statement? Is it a test that MyClass is not part of any multiple inheritance hierarchy (or anything that causes a famous actor to change the value of p)?
reinterpret_cast<T*>(p) , , reinterpret_cast<T*>(p) , , , . reinterpret_cast , , , .
reinterpret_cast<T*>(p)
reinterpret_cast
static_cast<T*>(p), . , static_cast<T*>(p) , p T* p, [] ( void*). , static_cast<T*>(p) . , .
static_cast<T*>(p)
p
T*
void*
, , . , , , reinterpret_cast<T*>(p), , . , , , .
, ASSERT() : " !"
ASSERT()