nil*_*lus 3 c# struct garbage-collection
我创建了带有引用类型和属性的静态数组的struct,它通过存储在struct中的唯一id从该数组获取对象 - 但我不知道它有任何意义,我想在堆栈上存储struct.
struct TestStruct
{
static TestClass[] Instances = new TestClass[16];
int uid; //max value = 15
TestClass Instance
{
get { return Instances[uid]; }
}
}
Run Code Online (Sandbox Code Playgroud)