假设我有一个非常简单的C#结构体
public struct foo{
public int a{get;set;}
public int b{get;set;}
public int c{get;set;}
public int d{get;set;}
public string hello {get;set;}
}
我理解上述方法比使用class
更加“高效”?
如果我继续添加字符串属性,从什么时候开始应该将结构体转换为类?
编辑:我计划在一个以GDI为中心的应用程序中传递这个结构体。我一直认为当主要处理值类型时,结构体的性能更好。