[basic.ios.cons]

# 31 Input/output library [[input.output]](./#input.output)

## 31.5 Iostreams base classes [[iostreams.base]](iostreams.base#basic.ios.cons)

### 31.5.4 Class template basic_ios [[ios]](ios#basic.ios.cons)

#### 31.5.4.2 Constructors [basic.ios.cons]

[ð](#lib:basic_ios,constructor)

`explicit basic_ios(basic_streambuf<charT, traits>* sb);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L1879)

*Effects*: Assigns initial values to its member objects by callinginit(sb)[.](#1.sentence-1)

[ð](#lib:basic_ios,constructor_)

`basic_ios();
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L1891)

*Effects*: Leaves its member objects uninitialized[.](#2.sentence-1)

The object
shall be initialized by callingbasic_ios​::​init before its first use or before it is destroyed, whichever comes first; otherwise the
behavior is undefined[.](#2.sentence-2)

[ð](#lib:basic_ios,destructor)

`~basic_ios();
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L1906)

*Remarks*: The destructor does not destroyrdbuf()[.](#3.sentence-1)

[ð](#lib:init,basic_ios)

`void init(basic_streambuf<charT, traits>* sb);
`

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L1918)

*Postconditions*: The postconditions of this function are indicated in Table [142](#tab:basic.ios.cons "Table 142: basic_­ios​::​init() effects")[.](#4.sentence-1)

Table [142](#tab:basic.ios.cons) — basic_ios​::​init() effects [[tab:basic.ios.cons]](./tab:basic.ios.cons)  

| [ð](#tab:basic.ios.cons-row-1)<br>**Element** | **Value** |
| --- | --- |
| [ð](#tab:basic.ios.cons-row-2)<br>rdbuf() | sb |
| [ð](#tab:basic.ios.cons-row-3)<br>tie() | 0 |
| [ð](#tab:basic.ios.cons-row-4)<br>rdstate() | goodbit if sb is not a null pointer, otherwise badbit[.](#tab:basic.ios.cons-row-4-column-2-sentence-1) |
| [ð](#tab:basic.ios.cons-row-5)<br>exceptions() | goodbit |
| [ð](#tab:basic.ios.cons-row-6)<br>flags() | skipws | dec |
| [ð](#tab:basic.ios.cons-row-7)<br>width() | 0 |
| [ð](#tab:basic.ios.cons-row-8)<br>precision() | 6 |
| [ð](#tab:basic.ios.cons-row-9)<br>fill() | widen(' ') |
| [ð](#tab:basic.ios.cons-row-10)<br>getloc() | a copy of the value returned by locale() |
| [ð](#tab:basic.ios.cons-row-11)<br>*iarray* | a null pointer |
| [ð](#tab:basic.ios.cons-row-12)<br>*parray* | a null pointer |
