就编程语言而言, AFAIKvoid
毫无意义。那么为什么在.Net框架中它被声明为struct
?
using System.Runtime.InteropServices;
namespace System
{
/// <summary>
/// Specifies a return value type for a method that does not return a value.
/// </summary>
/// <filterpriority>2</filterpriority>
[ComVisible(true)]
[Serializable]
[StructLayout(LayoutKind.Sequential, Size = 1)]
public struct Void
{
}
}