Logo Search packages:      
Sourcecode: ragel version File versions

template<class T, class Resize>
void SVector< T, Resize >::insert ( long  pos,
const T *  val,
long  len 
) [inline]

Insert len elements at position pos.

Elements in the vector from pos onward are shifted len spaces to the right. The copy constructor is used to place the elements into this vector. If pos is greater than the length of the vector then undefined behaviour results. If pos is negative then it is treated as an offset relative to the length of the vector.

Definition at line 607 of file svector.h.

References STable< T >::data.

{
      /* Do the common insertion stuff. */
      pos = insertCommon( pos, len );

      /* Copy data in element by element. */
      T *dst = BaseTable::data + pos;
      const T *src = val;
      for ( long i = 0; i < len; i++, dst++, src++ )
            new(dst) T(*src);
}


Generated by  Doxygen 1.6.0   Back to index