std::ios_base::ios_base
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
public: ios_base( const ios_base& ) = delete; |
(1) | |
protected: ios_base(); |
(2) | |
被删除的拷贝构造器:是不是复制的数据流
2) 原文:
The copy constuctor is deleted: streams are not copyable
默认的构造函数是受保护的,只有派生类构造
std::ios_base
。施工后的内部状态是不确定的。派生类必须第一次使用前或析构函数之前调用basic_ios::init()完成初始化,否则该行为是未定义的.原文:
The default constructor is protected: only derived classes may construct
std::ios_base
. The internal state is undefined after the construction. The derived class must call basic_ios::init() to complete initialization before first use or before destructor, otherwise the behavior is undefined.[编辑] 注释
这同样适用于在I / O层次,std::basic_ios下一个类的构造函数的。进一步派生类(std::istreamstd::ostream)总是一个具体的streambuffer的对象并调用basic_ios::init()建造,可能不止一次,完成初始化自己的虚拟基础.
原文:
The same applies to the constructors of the next class in the I/O hierarchy, std::basic_ios. Further-derived classes (std::istream and std::ostream) are always constructed with a concrete streambuffer object and call basic_ios::init(), possibly more than once, to complete initialization of their virtual base.