Ejemplo n.º 1
0
 public override object Clone()
 {
     lock (root)
     {
         return(deque.Clone());
     }
 }
Ejemplo n.º 2
0
        private static void TestClone(Deque <int> deque)
        {
            deque.Clear();

            PopulateDequePushBack(deque);

            Deque <int> deque2 = (Deque <int>)deque.Clone();

            Debug.Assert(deque.Count == deque2.Count);

            IEnumerator <int> d2 = deque2.GetEnumerator();

            d2.MoveNext();

            foreach (int item in deque)
            {
                Debug.Assert(item.Equals(d2.Current));

                d2.MoveNext();
            }
        }
Ejemplo n.º 3
0
        private static void TestClone(Deque deque)
        {
            deque.Clear();

            PopulateDequePushBack(deque);

            Deque deque2 = (Deque)deque.Clone();

            Debug.Assert(deque.Count == deque2.Count);

            IEnumerator d2 = deque2.GetEnumerator();

            d2.MoveNext();

            foreach (object obj in deque)
            {
                Debug.Assert(obj.Equals(d2.Current));

                d2.MoveNext();
            }
        }