为什么在
Int32
的源代码中使用了 int
?在 C# 中 Int32
等同于 int
,所以 int
的原始源代码是什么?我很糊涂。[Serializable]
[System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential)]
[System.Runtime.InteropServices.ComVisible(true)]
#if GENERICS_WORK
public struct Int32 : IComparable, IFormattable, IConvertible
, IComparable<Int32>, IEquatable<Int32>
/// , IArithmetic<Int32>
#else
public struct Int32 : IComparable, IFormattable, IConvertible
#endif
{
internal int m_value; // Here????
public const int MaxValue = 0x7fffffff;
public const int MinValue = unchecked((int)0x80000000);
...
}
在Boolean
和bool
之间也存在相同的问题。
int
的原始源代码。一些实际的内部工作是编译器和运行时的一部分,但就源代码而言,那就是源代码。 - user743382