This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
[output.iterators]
# 24 Iterators library [[iterators]](./#iterators)
## 24.3 Iterator requirements [[iterator.requirements]](iterator.requirements#output.iterators)
### 24.3.5 C++17 iterator requirements [[iterator.cpp17]](iterator.cpp17#output.iterators)
#### 24.3.5.4 Output iterators [output.iterators]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L2174)
A class or pointer typeX meets the requirements of an output iterator
if X meets the *Cpp17Iterator* requirements ([[iterator.iterators]](iterator.iterators "24.3.5.2Cpp17Iterator"))
and the expressions in Table [80](#tab:outputiterator "Table 80: Cpp17OutputIterator requirements (in addition to Cpp17Iterator)") are valid and have the indicated semantics[.](#1.sentence-1)
Table [80](#tab:outputiterator) — *Cpp17OutputIterator* requirements (in addition to *Cpp17Iterator*) [[tab:outputiterator]](./tab:outputiterator)
| [🔗](#tab:outputiterator-row-1)<br>**Expression** | **Return type** | **Operational** | **Assertion/note** |
| --- | --- | --- | --- |
| [🔗](#tab:outputiterator-row-2) | | **semantics** | **pre-/post-condition** |
| [🔗](#tab:outputiterator-row-3)<br>*r = o | result is not used | | *Remarks*: After this operation r is not required to be dereferenceable[.](#tab:outputiterator-row-3-column-4-sentence-1)<br> *Postconditions*: r is incrementable[.](#tab:outputiterator-row-3-column-4-sentence-2) |
| [🔗](#tab:outputiterator-row-4)<br>++r | X& | | addressof(r) == addressof(++r)[.](#tab:outputiterator-row-4-column-4-sentence-1)<br> *Remarks*: After this operation r is not required to be dereferenceable[.](#tab:outputiterator-row-4-column-4-sentence-2)<br> *Postconditions*: r is incrementable[.](#tab:outputiterator-row-4-column-4-sentence-3) |
| [🔗](#tab:outputiterator-row-5)<br>r++ | convertible to const X& | { X tmp = r; ++r; return tmp; } | *Remarks*: After this operation r is not required to be dereferenceable[.](#tab:outputiterator-row-5-column-4-sentence-1)<br> *Postconditions*: r is incrementable[.](#tab:outputiterator-row-5-column-4-sentence-2) |
| [🔗](#tab:outputiterator-row-6)<br>*r++ = o | result is not used | | *Remarks*: After this operation r is not required to be dereferenceable[.](#tab:outputiterator-row-6-column-4-sentence-1)<br> *Postconditions*: r is incrementable[.](#tab:outputiterator-row-6-column-4-sentence-2) |
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L2216)
*Recommended practice*: The implementation of an algorithm on output iterators
should never attempt to pass through the same iterator twice;
such an algorithm should be a single-pass algorithm[.](#2.sentence-1)
[*Note [1](#note-1)*:
The only valid use of an operator* is on the left side of the assignment statement[.](#2.sentence-2)
Assignment through the same value of the iterator happens only once[.](#2.sentence-3)
Equality and inequality are not necessarily defined[.](#2.sentence-4)
— *end note*]

1097
cppdraft/output/streams.md Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,17 @@
[output.streams.general]
# 31 Input/output library [[input.output]](./#input.output)
## 31.7 Formatting and manipulators [[iostream.format]](iostream.format#output.streams.general)
### 31.7.6 Output streams [[output.streams]](output.streams#general)
#### 31.7.6.1 General [output.streams.general]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L5912)
The header [<ostream>](ostream.syn#header:%3costream%3e "31.7.2Header <ostream> synopsis[ostream.syn]") defines a class template
and several function templates that control output to a stream buffer,
along with a function template that inserts into stream rvalues[.](#1.sentence-1)