std::ios::eof
bool eof() const;
Returns true
if the eofbit error state flag is set for the stream.
检查eofbit被设置,如果被设置则返回 true
This flag is set by all standard input operations when the End-of-File is reached in the sequence associated with the stream.
如果与输入流相关联的序列达到了End-of-File标志,任何标准的输入操作都可以将此标志设置为eofbit
Parameters (参数)
none
没有参数
Return Value(返回值)
true
if the stream's eofbit error state flag is set (which signals that the End-of-File has been reached in an input operation).
false
otherwise.
如果流的错误标志 eofbit 被设置,则会返回true(标明该输入操作已经达到了End-of-File标志),否则返回false。
Data races(数据竞争)
Accesses the stream object.
Concurrent access to the same stream object may cause data races.
获取流类对象
针对相同流的操作可能会引发数据竞争。
Exception safety
Strong guarantee: if an exception is thrown, there are no changes in the stream.
如果抛出异常,流类对象并未发生任何改变。