Both compilers are correct.
reinterpret_cast
is not a hammer, it's a powerful precision tool. All uses of reinterpret_cast
have to involve at least one pointer or reference type as the source or as the destination, except for the degenerate case of an identity integral conversion (i.e. reinterpret_cast
from int
to int
is allowed and does nothing.)