Megosztás:


Figyelmeztetés C26471

Ne használja reinterpret_cast. A leadott void* lehet használni static_cast (type.1)

Megjegyzések

Kódelemzés neve: NO_REINTERPRET_CAST_FROM_VOID_PTR.

példa

void function(void* pValue)
{
    {
        int* pointerToInt = reinterpret_cast<int*>(pValue); // C26471, use static_cast instead
    }
    {
        int* pointerToInt = static_cast<int*>(pValue); // Good
    }
}

Lásd még

C++ alapvető irányelvek típusa.1