컴파일러 경고(수준 1) C4965
암시적 정수 상자 0; nullptr 또는 명시적 캐스트 사용
Visual C++는 값 형식의 암시적 boxing 기능을 제공합니다. C++용 관리 확장을 사용하여 null 할당을 초래한 명령이 이제 boxed int에 대한 할당이 됩니다.
자세한 내용은 boxing에 정의된 인터페이스의 private C++ 관련 구현입니다.
예시
다음 샘플에서는 C4965를 생성합니다.
// 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);
}