Files
cppdraft_translate/cppdraft/ospanstream/cons.md
2025-10-25 03:02:53 +03:00

35 lines
1.3 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[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<charT> 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<charT, traits>(addressof(*sb*)) and *sb* withbasic_spanbuf<charT, traits>(s, which | ios_base::out) ([[spanbuf.cons]](spanbuf.cons "31.9.3.2Constructors"))[.](#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<charT, traits>::set_rdbuf(addressof(*sb*)) is called to install the contained basic_spanbuf[.](#2.sentence-2)