ios_base::iword | public member function |
long& iword (int idx); |
Get reference to integer element of the internal extensible array
Returns a reference to an object of type long which corresponds to the index idx of the internal extensible array. If idx is an index to a new element and the internal extensible array is not long enough (or is not yet allocated), the function extends it (or allocates it) with as many zero-initialized elements as necessary.
idx should be a value previously returned by member xalloc.
The refence returned is granted to be valid at least until another operation is performed on the stream object, including another call to iword. Once another operation is performed, the reference may become invalid, although a subsequent call to this same function with the same idx argument will return a value referring to the same value within the internal extensible array.
The internal extensible array is a general-purpose array of word-sized elements associated with a stream object that can be used to temporarily store data.
Parameters
- idx
- The index value of an element of the internal extensible array.
This value should have been obtained by a previous call to member xalloc.
Return Value
A reference to the element in the internal extensible array whose index is idx.This value is returned as a reference to an object of type long.
On failure, a valid long& initialized to 0 is returned.
See also
ios_base::xalloc | Return a new index for the internal extensible array [static] (public static member function) |
ios_base::pword | Get reference to pointer of the internal extensible array (public member function) |