Last active
August 29, 2015 13:57
-
-
Save kamiyaowl/9469480 to your computer and use it in GitHub Desktop.
c#ループカウンタをクロージャ変数として使うときのforの隠蔽
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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