Exemplo n.º 1
0
 /// <summary>
 /// Inserts count copies of value into the vector in front of pos
 /// </summary>
 /// <param name="pos"></param>
 /// <param name="count"></param>
 /// <param name="value"></param>
 public void Insert(ListIterator <T> pos, int count, T value)
 {
     CheckReAlloc(m_Count + count);
     if (!pos.Equals(End()))
     {
         Shift(pos.Position, (int)count);
     }
     Algorithm.FillN(new ListIterator <T>(m_Array, pos.Position), (int)count, value);
     m_Count += count;
 }
Exemplo n.º 2
0
        private void Insert(ListIterator <T> pos, InputIterator <T> begin, InputIterator <T> end, int newItems)
        {
            CheckReAlloc(m_Count + newItems);

            if (!pos.Equals(End()))
            {
                Shift(pos.Position, newItems);
            }

            Algorithm.Copy(begin, end, new ListIterator <T>(m_Array, pos.Position));
            m_Count += newItems;
        }