public override T[] ToArray() { lock (root) { return(deque.ToArray()); } }
private static void TestToArray(Deque <int> deque) { deque.Clear(); PopulateDequePushBack(deque); int[] array = deque.ToArray(); int i = 0; foreach (int item in deque) { Debug.Assert(item.Equals(array[i])); i++; } }
private static void TestToArray(Deque deque) { deque.Clear(); PopulateDequePushBack(deque); object[] array = deque.ToArray(); int i = 0; foreach (object obj in deque) { Debug.Assert(obj.Equals(array[i])); i++; } }