结构,枚举,类,接口,还有什么?

naw*_*fal 5 .net c# struct types class

当我写一些处理反射的辅助函数时,我正在思考这个问题.除了classes,structs,enums和interfaces 之外还有其他什么吗?如果我写的检查功能class,struct,enuminterface,会是这样的无所不包的功能

我读到这里这里的delegate课程无论如何都是.

帮助我完善这种层次结构的想法:

   reference type                   value type
         |                               |    
  ---------------                   ----------
  |             |                   |        |
interface    class                struct    enum


// the all encompassing function - pseudo code:
public static bool IsC#Stuff(this Type type)
{
    return type.IsEnum || type.IsStruct || type.IsClass || type.IsInterface;
}
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?

SLa*_*aks 3

还有数组和委托,尽管它们实际上是类。

泛型方法或类型的定义中还存在引用(ref方法的参数)和泛型类型参数。

在不安全的代码中,也有指针。