ios_base::xalloc
Specifica che una variabile fa parte del flusso.
static int xalloc( );
Valore restituito
La funzione membro statico restituisce un valore statico archiviato, che incrementa a ogni chiamata.
Note
È possibile utilizzare il valore restituito come argomento dell'indice univoco quando si chiamano le funzioni membro iword o pword.
Esempio
// ios_base_xalloc.cpp
// compile with: /EHsc
// Lets you store user-defined information.
// iword, jword, xalloc
#include <iostream>
int main( )
{
using namespace std;
static const int i = ios_base::xalloc();
static const int j = ios_base::xalloc();
cout.iword( i ) = 11;
cin.iword( i ) = 13;
cin.pword( j ) = "testing";
cout << cout.iword( i ) << endl;
cout << cin.iword( i ) << endl;
cout << ( char * )cin.pword( j ) << endl;
}
Requisiti
intestazione: <ios>
Spazio dei nomi: deviazione standard