[syncstream.osyncstream.cons]

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

## 31.11 Synchronized output streams [[syncstream]](syncstream#osyncstream.cons)

### 31.11.3 Class template basic_osyncstream [[syncstream.osyncstream]](syncstream.osyncstream#cons)

#### 31.11.3.2 Construction and destruction [syncstream.osyncstream.cons]

[ð](#lib:basic_osyncstream,constructor)

`basic_osyncstream(streambuf_type* buf, const Allocator& allocator);
`

[1](#1)

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

*Effects*: Initializes *sb* from buf and allocator[.](#1.sentence-1)

Initializes the base class with basic_ostream<charT, traits>(addressof(*sb*))[.](#1.sentence-2)

[2](#2)

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

[*Note [1](#note-1)*:

The member functions of the provided stream buffer
can be called from emit() while a lock is held,
which might result in a deadlock if used incautiously[.](#2.sentence-1)

â *end note*]

[3](#3)

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

*Postconditions*: get_wrapped() == buf is true[.](#3.sentence-1)

[ð](#lib:basic_osyncstream,constructor_)

`basic_osyncstream(basic_osyncstream&& other) noexcept;
`

[4](#4)

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

*Effects*: Move constructs the base class
and *sb* from the corresponding subobjects of other,
and calls basic_ostream<charT, traits>​::​set_rdbuf(addressof(*sb*))[.](#4.sentence-1)

[5](#5)

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

*Postconditions*: The value returned by get_wrapped() is the value returned by other.get_wrapped() prior to calling this constructor[.](#5.sentence-1)

nullptr == other.get_wrapped() is true[.](#5.sentence-2)
