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

24
cppdraft/projected.md Normal file
View File

@@ -0,0 +1,24 @@
[projected]
# 24 Iterators library [[iterators]](./#iterators)
## 24.3 Iterator requirements [[iterator.requirements]](iterator.requirements#projected)
### 24.3.6 Indirect callable requirements [[indirectcallable]](indirectcallable#projected)
#### 24.3.6.4 Alias template projected [projected]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L2515)
Alias template projected is used to constrain algorithms
that accept callable objects and projections ([[defns.projection]](defns.projection "3.44projection"))[.](#1.sentence-1)
It combines an [indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2Concept indirectly_­readable[iterator.concept.readable]") type I and
a callable object type Proj into a new [indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2Concept indirectly_­readable[iterator.concept.readable]") type
whose reference type is the result of applyingProj to the iter_reference_t of I[.](#1.sentence-2)
[🔗](#lib:projected)
namespace std {template<class I, class Proj>struct *projected-impl* { // *exposition only*struct *type* { // *exposition only*using value_type = remove_cvref_t<indirect_result_t<Proj&, I>>; using difference_type = iter_difference_t<I>; // present only if I// models [weakly_incrementable](iterator.concept.winc#concept:weakly_incrementable "24.3.4.4Concept weakly_­incrementable[iterator.concept.winc]") indirect_result_t<Proj&, I> operator*() const; // *not defined*}; }; template<[indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2Concept indirectly_­readable[iterator.concept.readable]") I, [indirectly_regular_unary_invocable](indirectcallable.indirectinvocable#concept:indirectly_regular_unary_invocable "24.3.6.3Indirect callables[indirectcallable.indirectinvocable]")<I> Proj>using projected = *projected-impl*<I, Proj>::*type*;}