This might be a old question: Why does IEnumerable<T>
inherit from IEnumerable
?
This is how .NET do, but it brings a little trouble. Every time I write a class implements IEumerable<T>
, I have to write two GetEnumerator()
functions, one for IEnumerable<T>
and the other for IEnumerable
.
And, IList<T>
doesn't inherit from IList.
I don't know why IEnumerable<T>
is designed in other way.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…