a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
28 lines
325 B
C#
28 lines
325 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
public class Test<T>
|
|
{
|
|
protected T item;
|
|
|
|
public Test (T item)
|
|
{
|
|
this.item = item;
|
|
}
|
|
|
|
public IEnumerator<T> GetEnumerator()
|
|
{
|
|
yield return item;
|
|
}
|
|
}
|
|
|
|
class X
|
|
{
|
|
public static void Main ()
|
|
{
|
|
Test<int> test = new Test<int> (3);
|
|
foreach (int a in test)
|
|
;
|
|
}
|
|
}
|