Share via


Derleyici Uyarısı (düzey 1) C4965

0 tamsayısının örtük kutusu; nullptr veya açık atama kullanma

Visual C++ değer türlerinin örtük kutulama özelliğine sahiptir. C++ için Yönetilen Uzantılar kullanılarak null atamayla sonuçlanan yönerge artık kutulanmış bir int'e atama olur.

Daha fazla bilgi için bkz . Boxing.

Örnek

Aşağıdaki örnek C4965 oluşturur.

// C4965.cpp
// compile with: /clr /W1
int main() {
   System::Object ^o = 0;   // C4965

   // the previous line is the same as the following line
   // using Managed Extensions for C++
   // System::Object *o = __box(0);

   // OK
   System::Object ^o2 = nullptr;
   System::Object ^o3 = safe_cast<System::Object^>(0);
}