I/O manipulators | ||||
Print functions(C++23) | ||||
C-style I/O | ||||
Buffers | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++20) | ||||
Streams | ||||
Abstractions | ||||
File I/O | ||||
String I/O | ||||
Array I/O | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
Synchronized Output | ||||
(C++20) | ||||
Types | ||||
Error category interface | ||||
(C++11) | ||||
(C++11) |
Member functions | ||||
State functions | ||||
Formatting | ||||
Miscellaneous | ||||
Protected member functions | ||||
basic_ios::init | ||||
(C++11) | ||||
(C++11) | ||||
(C++11) |
protected: void init(std::basic_streambuf<CharT,Traits>* sb); | ||
Sets the associated stream buffer tosb and initializes the internal state.
The postconditions are as follows:
Element | Value |
---|---|
rdbuf() | sb |
tie() | null pointer |
rdstate() | goodbit ifsb is not a null pointer, otherwisebadbit |
exceptions() | goodbit |
flags() | skipws| dec |
width() | 0 |
precision() | 6 |
fill() | widen(' ') |
getloc() | a copy of the value returned bystd::locale() |
This member function is protected: it is called by the constructors of the derived stream classesstd::basic_istream andstd::basic_ostream once the associated stream buffer is known. Until this function is called, every member function (including the destructor) of the default-constructedstd::basic_ios invokes undefined behavior. Note thatbasic_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 (public member function)[edit] |