- 博客(1)
- 收藏
- 关注
原创 IEnumerable
IEnumerable<T>` 接口是许多集合类(如 `List<T>`, `Dictionary<TKey, TValue>`, `Array` 等)的基础,并且它是实现迭代器模式的关键接口之一。`IEnumerable<T>` 的主要用途是在 foreach 循环中遍历集合,因为 C# 编译器会在编译期间将 foreach 循环转换为对 `GetEnumerator()`、`MoveNext()` 和 `Current` 属性的调用。- `IEnumerable<T>` 不保证线程安全。
2024-12-11 23:43:25
276
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人