Logo Search packages:      
Sourcecode: djvulibre version File versions  Download package

template<class TYPE>
void GArrayTemplate< TYPE >::touch ( int  n  )  [inline, inherited]

Extends the subscript range so that it contains n#. This function does nothing if n# is already int the valid subscript range. If the valid range was empty, both the lower bound and the upper bound are set to n#. Otherwise the valid subscript range is extended to encompass n#. This function is very handy when called before setting an array element: {verbatim} int lineno=1; GArray<GString> a; while (! end_of_file()) { a.touch(lineno); a[lineno++] = read_a_line(); } {verbatim}

Definition at line 493 of file GContainer.h.

Referenced by JB2Image::add_blit(), and JB2Dict::add_shape().

    { if (n<lobound || n>hibound) GArrayBase::touch(n); }

Generated by  Doxygen 1.6.0   Back to index