basic_ostream::sentry

嵌套类描述声明生成格式化输出功能和无格式的输出功能的对象。

class sentry {
public:
    explicit sentry( basic_ostream<_Elem, _Tr>& _Ostr );
    operator bool( ) const;
    ~sentry( );
};

备注

嵌套类描述声明生成格式化输出功能和无格式的输出功能的对象。 如果 **ostr.**为 true,则 **ostr.**和关系 不是空指针,构造函数调用 ostr.tie->刷新 构造函数然后存储在 状态ostr.good 返回的值。 对 operator bool 的一个调用提供此存储最新的值。

如果 uncaught_exception 返回 false,以及 标志&unitbuf 是非零,析构函数调用。刷新

要求

页眉: <ostream>

命名空间: std

请参见

参考

basic_ostream 类

iostream 编程

iostreams 约定