真面目に目的を達成するだけなら、
MSDN Forum のほうに書いたコードのような、値の更新をサポートする ForEach があればいいんですよね。
public class ValueList<T> ; List<T> where T : struct { public void ReflectForEach(Converter<T,T> action) { if (action == null) throw new ArgumentNullException(...); for (int index = 0; index < this.Count; index++) ReflectValue(index, action); } public void Reflect(int index, Converter<T,T> action) { if (action == null) throw new ArgumentNullException(...); if (index < 0) throw new ArgumentOutOfRangeException(...); if (index >= this.Count) throw new ArgumentOutOfRangeException(...); ReflectValue(index, action); } protected void ReflectValue(int index, Converter<T,T> action) { this[index] = action(this[index]); } }
とかさ? ( ref T 型を引数にとる delegate を用意したほうがスマートだと思いますが )