08/10/03 22:27:26
>>400
valuesじゃ駄目だろうか?
public static class IEnumerableExtensions {
public static void Each<T>(this IEnumerable<T> values, Action<T> action) {
foreach (T obj in values) { action(obj); }
}
public static void EachWithIndex<T>(this IEnumerable<T> values, Action<T, int> action){
int index = 0;
foreach (T obj in values){
action(obj, index++);
}
}
}