【发布时间】:2010-12-30 15:37:19
【问题描述】:
根据http://msdn.microsoft.com/en-us/library/ms229017.aspx,值类型“分配在堆栈上或与其他结构内联*”。然而在the stack is an implementation detail 中,Eric Lippert 指出这是一个实现细节。
据我了解,实现细节是"a behavior produced by code which may be relied on by consuming code, though that behavior is not specified by the spec the code is written to."。我知道文档不是规范,尽管如果文档中列出了我们可以依赖的东西并且它不再是实现细节,那么它大概是。那么,堆栈是实现细节还是不是?
*:我理解这意味着结构也可以在其他结构内部分配,而不是直接在堆上,尽管我可能错了。
【问题讨论】:
-
我刚刚将其标记为重复 :)
标签: .net stack value-type