◐ Shell
clean mode source ↗

std::basic_ostream::sentry - cppreference.com

De cppreference.com

<metanoindex/>

<tbody> </tbody>

Definido no cabeçalho

<ostream>

template< class CharT, class Traits = std::char_traits<CharT> > class std::basic_istream<charT,traits>::sentry

Um objeto da classe basic_ostream::sentry é construído em âmbito local, no início de cada função de membro de std::basic_ostream que realiza a saída (ambos formatados e não formatados). Seu construtor prepara o fluxo de saída: verifica se o fluxo já está em um estado falido, libera o empate () 'd fluxos de saída, e executa outras tarefas de execução definidos, se necessário. Definido pela implementação de limpeza, bem como a lavagem da corrente de saída, se necessário, é realizada no processo de destruição, de modo que é garantido que aconteceria se excepções são lançados durante a saída.

Original:

An object of class basic_ostream::sentry is constructed in local scope at the beginning of each member function of std::basic_ostream that performs output (both formatted and unformatted). Its constructor prepares the output stream: checks if the stream is already in a failed state, flushes the tie()'d output streams, and performs other implementation-defined tasks if necessary. Implementation-defined cleanup, as well as flushing of the output stream if necessary, is performed in the destructor, so that it is guaranteed to happen if exceptions are thrown during output.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Funções de membro

constrói o object.
All sentinela as tarefas de preparação é feito aqui

Original:

constructs the sentry object.
All the preparation tasks are done here

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função pública membro) [edit]

finaliza o objeto de fluxo após saída formatada ou depois de exceção, se for necessário

Original:

finalizes the stream object after formatted output or after exception, if necessary

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função pública membro)

operator=

o operador de atribuição é excluído

Original:

the assignment operator is deleted

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função pública membro)

verifica se a preparação de objeto de fluxo foi bem sucedida

Original:

checks if the preparation of the stream object was successful

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função pública membro) [edit]

Exemplo

Veja também

insere dados formatados

Original:

inserts formatted data

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função pública membro) [edit]