-
'ref struct' looks like it's telling you that the struct is a reference-like type.In effect,it is stuck on the stack.So why not call it 'stack struct'? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Here the |
Beta Was this translation helpful? Give feedback.
-
Correct would be "by-reference-like type". It means that compiler should enforce the same rules for such a struct as for example
So I wouldn't really tie naming to the stack although we might never see heap-to-heap refs and only stack-to-* ones. |
Beta Was this translation helpful? Give feedback.
Correct would be "by-reference-like type". It means that compiler should enforce the same rules for such a struct as for example
ref int
.Living on the stack is an implementation detail/constraint. It could be theoretically possible for a class to have ref field for example. The problems are:
So I wouldn't really tie nami…