Created
April 27, 2014 09:33
-
-
Save SergeyTeplyakov/11341486 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var list = new List<int>{42}; | |
var lIter = list.GetEnumerator(); | |
lIter.MoveNext(); | |
list.Add(12); | |
Console.WriteLine(lIter.Current); // 1 | |
Console.WriteLine(lIter.MoveNext()); // 2 | |
// Тоже самое но с LinkedList | |
var linked = new LinkedList<int>(); | |
var linkedIter = linked.GetEnumerator(); | |
linkedIter.MoveNext(); | |
// Инициализатор коллекций не работает для LinkedList | |
linked.AddLast(12); | |
Console.WriteLine(linkedIter.Current); // 3 | |
Console.WriteLine(linkedIter.MoveNext()) // 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Точка с запятой пропущена в 17 строчке