std::basic_ios::init

来自cppreference.com
< cpp‎ | io‎ | basic ios

protected:
void init( std::basic_streambuf<CharT,Traits>* sb );
设置相关的数据流缓冲sb并初始化内部状态.
原文:
Sets the associated stream buffer to sb and initializes the internal state.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。
后置条件如下:
原文:
The postconditions are as follows:
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。
Element Value
rdbuf() sb
tie() NULL
rdstate() goodbit if sb is not NULL, otherwise badbit
exceptions() goodbit
flags() skipws | dec
width() 0
precision() 6
fill() widen(' ')
getloc() a copy of the value returned by std::locale()
这个成员函数是被保护的,它被称为派生的流类的构造函数被称为std::basic_istreamstd::basic_ostream后,相关的数据流缓冲。这个函数被调用之前,的默认构造std::basic_ios的每一个成员函数,(以外的析构函数)调用未定义的行为。需要注意的是basic_ios是一个虚基类,因此它的构造函数不调用的构造函数直接派生类,这就是为什么两个阶段的初始化是必要的.
原文:
This member function is protected: it is called by the constructors of the derived stream classes std::basic_istream and std::basic_ostream once the associated stream buffer is known. Until this function is called, every member function (other than the destructor) of the default-constructed std::basic_ios invokes undefined behavior. Note that basic_ios is a virtual base class, and therefore its constructor is not called by the constructors of those directly derived classes, which is why two-stage initialization is necessary.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

[编辑] 参数

sb -
关联到流缓存器
原文:
stream buffer to associate to
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

[编辑] 另请参阅

构造对象
原文:
constructs the object
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

(公开成员函数) [编辑]