Details on what happens when a struct implements an interface
问题 I recently came across this Stackoverflow question: When to use struct? In it, it had an answer that said something a bit profound: In addition, realize that when a struct implements an interface - as Enumerator does - and is cast to that implemented type, the struct becomes a reference type and is moved to the heap. Internal to the Dictionary class, Enumerator is still a value type. However, as soon as a method calls GetEnumerator(), a reference-type IEnumerator is returned. Exactly what