Skip to content

Instantly share code, notes, and snippets.

@kamiyaowl
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamiyaowl/9469480 to your computer and use it in GitHub Desktop.
Save kamiyaowl/9469480 to your computer and use it in GitHub Desktop.
c#ループカウンタをクロージャ変数として使うときのforの隠蔽
namespace kamiya.util{
public static class Extensions {
public static void IndexedProcess<T>(this List<T> list, Action<T, byte> process) {
for (int i = 0; i < list.Count; ++i) {
var index = i;
process(list[i], index);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment