Logo Search packages:      
Sourcecode: ragel version File versions

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

Replace at position pos with len new elements.

If there are existing elements at the positions to be replaced, then destructors are called before the space is used. The default constructor is used to initialize the new elements. It is allowable for the pos and length to specify a replacement that overwrites existing elements and creates new ones. 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 430 of file svector.h.

References STable< T >::data.

{
      /* Do the common replacement stuff. */
      pos = replaceCommon( pos, len );

      /* Copy data in using copy constructor. */
      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