Logo Search packages:      
Sourcecode: ragel version File versions

template<class T, class Resize>
void SVector< T, Resize >::insertDup ( long  pos,
const T &  item,
long  len 
) [inline]

Insert len copies of item 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 element 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 640 of file svector.h.

References STable< T >::data.

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

      /* Copy the data item in one at a time. */
      T *dst = BaseTable::data + pos;
      for ( long i = 0; i < len; i++, dst++ )
            new(dst) T(item);
}


Generated by  Doxygen 1.6.0   Back to index