Hi there, I have a question about the IEnumerator.GetEnumerator()
method.
public class NodeFull
{
public enum Base : byte {A = 0, C, G, U };
private int taxID;
private List<int> children;
public int TaxID
{
get { return taxID; }
set { taxID = value; }
}
public int this[int i]
{
get { return children[i]; }
set { children[i] = value; }
}
public IEnumerator GetEnumerator()
{
return (children as IEnumerator).GetEnumerator();
}
public TaxNodeFull(int taxID)
{
this.taxID = taxID;
this.children = new List<int>(3);
}
}
When I try to compile, error message says
'System.Collections.IEnumerator' does not contain a definition for 'GetEnumerator' and no extension method 'GetEnumerator' accepting a first argument of type 'System.Collections.IEnumerator' could be found (are you missing a using directive or an assembly reference?)
Is there anything wrong with the code?
Thanks in advance
Thank you guys. I got it.