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

84 lines
2.0 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.

[spanbuf.cons]
# 31 Input/output library [[input.output]](./#input.output)
## 31.9 Span-based streams [[span.streams]](span.streams#spanbuf.cons)
### 31.9.3 Class template basic_spanbuf [[spanbuf]](spanbuf#cons)
#### 31.9.3.2 Constructors [spanbuf.cons]
[🔗](#lib:basic_spanbuf,constructor)
`explicit basic_spanbuf(std::span<charT> s,
ios_base::openmode which = ios_base::in | ios_base::out);
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10147)
*Effects*: Initializes the base class with basic_streambuf() ([[streambuf.cons]](streambuf.cons "31.6.3.2Constructors")),
and *mode* with which[.](#1.sentence-1)
Initializes the internal pointers as if calling span(s)[.](#1.sentence-2)
[🔗](#lib:basic_spanbuf,constructor_)
`basic_spanbuf(basic_spanbuf&& rhs);
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10160)
*Effects*: Initializes the base class with std::move(rhs) and*mode* with std::move(rhs.*mode*) and*buf* with std::move(rhs.*buf*)[.](#2.sentence-1)
The sequence pointers in *this (eback(), gptr(), egptr(),pbase(), pptr(), epptr())
obtain the values which rhs had[.](#2.sentence-2)
It isimplementation-defined
whether rhs.*buf*.empty() returns true after the move[.](#2.sentence-3)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10173)
*Postconditions*: Let rhs_p refer to the state of rhs just prior to this construction[.](#3.sentence-1)
- [(3.1)](#3.1)
span().data() == rhs_p.span().data()
- [(3.2)](#3.2)
span().size() == rhs_p.span().size()
- [(3.3)](#3.3)
eback() == rhs_p.eback()
- [(3.4)](#3.4)
gptr() == rhs_p.gptr()
- [(3.5)](#3.5)
egptr() == rhs_p.egptr()
- [(3.6)](#3.6)
pbase() == rhs_p.pbase()
- [(3.7)](#3.7)
pptr() == rhs_p.pptr()
- [(3.8)](#3.8)
epptr() == rhs_p.epptr()
- [(3.9)](#3.9)
getloc() == rhs_p.getloc()