Ejemplo n.º 1
0
        /// <summary>Creates a shallow clone of this data structure.</summary>
        /// <returns>A shallow clone of this data structure.</returns>
        public StackArray <T> Clone()
        {
            StackArray <T> clone = new StackArray <T>();

            clone._array = new T[this._array.Length];
            for (int i = 0; i < this._count; i++)
            {
                clone._array[i] = this._array[i];
            }
            clone._minimumCapacity = this._minimumCapacity;
            clone._count           = this._count;
            return(clone);
        }
Ejemplo n.º 2
0
		internal StackArray(StackArray<T> stack)
		{
			this._array = (T[])stack._array.Clone();
			this._count = stack._count;
			this._minimumCapacity = stack._minimumCapacity;
		}