리플렉션을 사용하여 System.Int32
의 내용을 검사 한 결과 다른 System.Int32
이 발견되었습니다.System.Int32 contains ... another System.Int32
System.Int32 m_value;
나는 그게 가능하지 않습니다.
이 int
정말 당신이 가지고있는 하나의 "백업 정수"입니다 :
object testInt = 4;
Console.WriteLine(testInt); // yields 4
typeof(System.Int32)
.GetField("m_value", BindingFlags.NonPublic | BindingFlags.Instance)
.SetValue(testInt, 5);
Console.WriteLine(testInt); // yields 5
: 당신은
m_value
필드의 값을 변경하는
int
및 사용 반사 상자, 당신은 효과적으로 정수의 값을 변경
이 특이점 뒤에는 합리적인 설명이 있어야합니다. 값 유형은 어떻게 자체를 포함 할 수 있습니까? CLR이 사용하기 위해 어떤 마법을 사용합니까?
[이 상자는 우리 자신의 우주를 포함합니다!] (http://www.gotfuturama.com/Multimedia/EpisodeSounds/4ACV15/) – GSerg