using System; using System.Collections.Generic; public class Test[T] { protected mutable item : T; public this (mutable item : T) { this.item = item; } public GetEnumerator() : IEnumerator[T] { yield item; } } class X { static Main () : void { mutable test = Test (3); foreach ( a in test) Console.WriteLine(a); } } /* BEGIN-OUTPUT 3 END-OUTPUT */