If a cast is necessary, use static_cast (or reinterpret_cast, whichever you need). Same below.