Logo Search packages:      
Sourcecode: ragel version File versions

template<class T, class Resize>
void SVector< T, Resize >::insertNew ( long  pos,
long  len 
) [inline]

Insert len new elements using the default constructor.

Elements in the vector from pos onward are shifted len spaces to the right. Default constructors are used to init the new elements. If pos is off the end 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 671 of file svector.h.

References STable< T >::data.

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

      /* Init new data with default constructors. */
      T *dst = BaseTable::data + pos;
      for ( long i = 0; i < len; i++, dst++ )
            new(dst) T();

Generated by  Doxygen 1.6.0   Back to index