There's a set of questions regarding cross-casts (cast from T1*
to unrelated T2*
), for example this and this. The answer usually goes like this: reinterpret_cast
is implementation defined and conversion to void*
followed by static_cast
is well-defined. Yet I haven't see any real examples of what can go wrong when reinterpret_cast
is used.
What are real-life examples where casting through void*
works and reinterpret_cast
doesn't?