Kyle A. answered 05/05/20
Senior Software Engineer Specializing in Systems Programming
Hi!
The purpose of reinterpret_cast is to reinterpret the bits of one value as the bits of another value. Generally reinterpret_cast is much less restrictive than other C++ style casts in that it will allow you to cast most types to most other types which is both it's strength and weakness. It is similar in use to a plain C-style cast and generally static_cast should be preferred if possible because it will prevent you from accidentally trying to convert one type to an incompatible type like converting a struct type to a pointer type.
Your example of converting a void* to a Class type should use static_cast as a conversion from void* to T* is a well defined conversion by the compiler as a void* is a valid pointer to a class type. By casting it, you are just making it more specific to the compiler what the pointer is pointing to. A reinterpret_cast is unnecessary here and static_cast should be preferred.
Hope this helps!