C++ 概念: UnformattedInputFunction
来自cppreference.com
![]() |
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
[编辑] 要求
UnformattedInputFunction
流输入功能,执行以下操作:- 构造一个对象具有自动存储时间和basic_istream::sentry参数设置为
noskipws
,将执行以下类型的true原文:Constructs an object of type basic_istream::sentry with automatic storage duration and with thenoskipws
argument set to true, which performs the following
- 如果eofbitbadbit上设置的输入流,设置
failbit
,并在此输入流的异常掩码,如果failbit异常启用抛出ios_base::failure.原文:if eofbit or badbit are set on the input stream, sets thefailbit
as well, and if exceptions on failbit are enabled in this input stream's exception mask, throws ios_base::failure.
-
- 检查的状态通过调用
sentry::operator bool()
,这是相当于basic_ios::good哨兵.原文:Checks the status of the sentry by callingsentry::operator bool()
, which is equivalent to basic_ios::good.
[编辑] 标准库
以下的标准库函数
UnformattedInputFunction
s.- basic_istream::operator>>(basic_streambuf*)
- basic_istream::get
- basic_istream::getline
- basic_istream::ignore
- basic_istream::peek
- basic_istream::read
- basic_istream::readsome
- basic_istream::sync,不同之处在于,它不修改gcount的
- basic_istream::tellg,不同之处在于,它不修改gcount的
- basic_istream::seekg,不同之处在于,它首先清除
eofbit
和不修改gcount的原文:basic_istream::seekg, except that it first clearseofbit
and does not modify gcount