[ospanstream.cons] # 31 Input/output library [[input.output]](./#input.output) ## 31.9 Span-based streams [[span.streams]](span.streams#ospanstream.cons) ### 31.9.5 Class template basic_ospanstream [[ospanstream]](ospanstream#cons) #### 31.9.5.2 Constructors [ospanstream.cons] [🔗](#lib:basic_ospanstream,constructor) `explicit basic_ospanstream(std::span s, ios_base::openmode which = ios_base::out); ` [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10635) *Effects*: Initializes the base class withbasic_ostream(addressof(*sb*)) and *sb* withbasic_spanbuf(s, which | ios_base​::​out) ([[spanbuf.cons]](spanbuf.cons "31.9.3.2 Constructors"))[.](#1.sentence-1) [🔗](#lib:basic_ospanstream,constructor_) `basic_ospanstream(basic_ospanstream&& rhs) noexcept; ` [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10649) *Effects*: Initializes the base class with std​::​move(rhs) and *sb* with std​::​move(rhs.*sb*)[.](#2.sentence-1) Next, basic_ostream​::​set_rdbuf(addressof(*sb*)) is called to install the contained basic_spanbuf[.](#2.sentence-2)