예제 #1
0
 public static void LoopWithPointer <T>(this IList <T> l, IteratorWithPointer <T> iter)
 {
     for (int i = 0; i < l.Count; ++i)
     {
         iter(l[i], i, i == 0, i == l.Count - 1);
     }
 }
예제 #2
0
 public static void LoopReverse <T>(this IList <T> l, IteratorWithPointer <T> iter)
 {
     for (int i = (l.Count - 1); i >= 0; --i)
     {
         iter(l[i], i, i == 0, i == l.Count - 1);
     }
 }