Jonathan Pryor is right you cannot access indexes from the enumerator. I
would use a normal loop for this. I posted a silly example using a
enumerator.
<code>
List<double> d;
int i = 0;
using (System.Collections.Generic.List<double>.Enumerator enumerator
d.GetEnumerator())
{
while (enumerator.MoveNext())
{
double min_e = min_element(i))
i++;
}
}
double min_element (int i)
{
using (System.Collections.Generic.List<double>.Enumerator enumerator
d.GetEnumerator())
{
while (i > 0)
{
enumerator.MoveNext();
i--;
while (enumerator.MoveNext())
{
if ()
{
notFound = false;
d = enumerator.Current;
}
}
while (enumerator.MoveNext())
{
checkMin(i, enumerator.Current))
i++;
}
}
}
<code>
--
View this message in context:
http://mono.1490590.n4.nabble.com/Minimum-element-of-a-list-tp3200185p3204542.html
Sent from the Mono - General mailing list archive at Nabble.com.
_______________________________________________
Mono-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list