/// <summary> /// Creates a shallow copy of the <see cref="ArrayQueue"/>. /// </summary> /// <returns>A shallow copy of the <see cref="ArrayQueue"/>.</returns> public ArrayQueue Clone() { var queue = new ArrayQueue(_array.Length); Array.Copy(_array, queue._array, _array.Length); queue.Count = Count; queue._head = _head; queue._tail = _tail; return(queue); }
/// <summary> /// Initializes a new instance of the <see cref="QueueStackEnumerator"/>. /// </summary> /// <param name="queue">The <see cref="ArrayQueue"/> queue.</param> public QueueStackEnumerator(ArrayQueue queue) { _queue = queue; _index = queue.Count == 0 ? 0 : -2; _current = null; }