In C++ for any data type I can do the following:
Type* typedPointer = obtain();
void* voidPointer = typedPointer;
which cast is performed when I assign Type* to void*? Is this the same as
Type* typedPointer = obtain();
void* voidPointer = reinterpret_cast<void*>( typedPointer );
or is it some other cast?
It is a standard pointer conversion. Since it is a standard conversion, it doesn’t require any explicit cast.
If you want to reproduce the behavior of that conversion with an explicit cast, it would be
static_cast, notreinterpret_cast.Be definition of
static_castgiven in 5.2.9/2,static_castcan perform all conversions that can be performed implicitly.