是否有任何不可重复的IEnumerable类? [英] Are there any non-repeatable IEnumerable classes?
本文介绍了是否有任何不可重复的IEnumerable类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有不可重复的IEnumerable类?
Are there any non-repeatable IEnumerable classes?
所谓不可重复,是指您不能安全地多次调用GetEnumerator或调用GetEnumerator有明显的副作用.
By non-repeatable I mean where you can't safely call GetEnumerator multiple times or where calling GetEnumerator has observable side effects.
推荐答案
File.ReadLines()
确实返回一个仅工作一次的IEnumerable<T>
.
File.ReadLines()
does return an IEnumerable<T>
that only works once.
这篇关于是否有任何不可重复的IEnumerable类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文