Logo Search packages:      
Sourcecode: ragel version File versions

template<class T, class Resize>
SVector< T, Resize > & SVector< T, Resize >::operator= ( const SVector< T, Resize > &  v  )  [inline]

Shallow copy another vector into this vector.

Takes a reference to the other vector. The contents of this vector are first emptied.

Returns:
A reference to this.

Definition at line 382 of file svectcommon.h.

References STable< T >::data, and SVector< T, Resize >::empty().

{
      /* First clean out the current contents. */
      empty();

      /* Take a reference to other, if any data is allocated. */
      if ( v.data == 0 )
            BaseTable::data = 0;
      else {
            /* Get the source header, up the refcount and ref it. */
            STabHead *srcHead = ((STabHead*) v.data) - 1;
            srcHead->refCount += 1;
            BaseTable::data = (T*) (srcHead + 1);
      }
      return *this;
}


Generated by  Doxygen 1.6.0   Back to index