[indirectcallable] # 24 Iterators library [[iterators]](./#iterators) ## 24.3 Iterator requirements [[iterator.requirements]](iterator.requirements#indirectcallable) ### 24.3.6 Indirect callable requirements [indirectcallable] #### [24.3.6.1](#general) General [[indirectcallable.general]](indirectcallable.general) [1](#general-1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L2430) There are several concepts that group requirements of algorithms that take callable objects ([[func.def]](func.def "22.10.3 Definitions")) as arguments[.](#general-1.sentence-1) #### [24.3.6.2](#traits) Indirect callable traits [[indirectcallable.traits]](indirectcallable.traits) [1](#traits-1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L2436) To implement algorithms taking projections, it is necessary to determine the projected type of an iterator's value type[.](#traits-1.sentence-1) For the exposition-only alias template *indirect-value-t*,*indirect-value-t* denotes - [(1.1)](#traits-1.1) invoke_result_t> if T names projected, and - [(1.2)](#traits-1.2) iter_value_t& otherwise[.](#traits-1.sentence-2) #### [24.3.6.3](#indirectinvocable) Indirect callables [[indirectcallable.indirectinvocable]](indirectcallable.indirectinvocable) [1](#indirectinvocable-1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L2451) The indirect callable concepts are used to constrain those algorithms that accept callable objects ([[func.def]](func.def "22.10.3 Definitions")) as arguments[.](#indirectinvocable-1.sentence-1) namespace std {templateconcept [indirectly_unary_invocable](#concept:indirectly_unary_invocable "24.3.6.3 Indirect callables [indirectcallable.indirectinvocable]") =[indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept indirectly_­readable [iterator.concept.readable]") &&[copy_constructible](concept.copyconstructible#concept:copy_constructible "18.4.14 Concept copy_­constructible [concept.copyconstructible]") &&[invocable](concept.invocable#concept:invocable "18.7.2 Concept invocable [concept.invocable]")> &&[invocable](concept.invocable#concept:invocable "18.7.2 Concept invocable [concept.invocable]")> &&[common_reference_with](concept.commonref#concept:common_reference_with "18.4.5 Concept common_­reference_­with [concept.commonref]")< invoke_result_t>, invoke_result_t>>; templateconcept [indirectly_regular_unary_invocable](#concept:indirectly_regular_unary_invocable "24.3.6.3 Indirect callables [indirectcallable.indirectinvocable]") =[indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept indirectly_­readable [iterator.concept.readable]") &&[copy_constructible](concept.copyconstructible#concept:copy_constructible "18.4.14 Concept copy_­constructible [concept.copyconstructible]") &&[regular_invocable](concept.regularinvocable#concept:regular_invocable "18.7.3 Concept regular_­invocable [concept.regularinvocable]")> &&[regular_invocable](concept.regularinvocable#concept:regular_invocable "18.7.3 Concept regular_­invocable [concept.regularinvocable]")> &&[common_reference_with](concept.commonref#concept:common_reference_with "18.4.5 Concept common_­reference_­with [concept.commonref]")< invoke_result_t>, invoke_result_t>>; templateconcept [indirect_unary_predicate](#concept:indirect_unary_predicate "24.3.6.3 Indirect callables [indirectcallable.indirectinvocable]") =[indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept indirectly_­readable [iterator.concept.readable]") &&[copy_constructible](concept.copyconstructible#concept:copy_constructible "18.4.14 Concept copy_­constructible [concept.copyconstructible]") &&[predicate](concept.predicate#concept:predicate "18.7.4 Concept predicate [concept.predicate]")> &&[predicate](concept.predicate#concept:predicate "18.7.4 Concept predicate [concept.predicate]")>; templateconcept [indirect_binary_predicate](#concept:indirect_binary_predicate "24.3.6.3 Indirect callables [indirectcallable.indirectinvocable]") =[indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept indirectly_­readable [iterator.concept.readable]") && [indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept indirectly_­readable [iterator.concept.readable]") &&[copy_constructible](concept.copyconstructible#concept:copy_constructible "18.4.14 Concept copy_­constructible [concept.copyconstructible]") &&[predicate](concept.predicate#concept:predicate "18.7.4 Concept predicate [concept.predicate]"), *indirect-value-t*> &&[predicate](concept.predicate#concept:predicate "18.7.4 Concept predicate [concept.predicate]"), iter_reference_t> &&[predicate](concept.predicate#concept:predicate "18.7.4 Concept predicate [concept.predicate]"), *indirect-value-t*> &&[predicate](concept.predicate#concept:predicate "18.7.4 Concept predicate [concept.predicate]"), iter_reference_t>; templateconcept [indirect_equivalence_relation](#concept:indirect_equivalence_relation "24.3.6.3 Indirect callables [indirectcallable.indirectinvocable]") =[indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept indirectly_­readable [iterator.concept.readable]") && [indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept indirectly_­readable [iterator.concept.readable]") &&[copy_constructible](concept.copyconstructible#concept:copy_constructible "18.4.14 Concept copy_­constructible [concept.copyconstructible]") &&[equivalence_relation](concept.equiv#concept:equivalence_relation "18.7.6 Concept equivalence_­relation [concept.equiv]"), *indirect-value-t*> &&[equivalence_relation](concept.equiv#concept:equivalence_relation "18.7.6 Concept equivalence_­relation [concept.equiv]"), iter_reference_t> &&[equivalence_relation](concept.equiv#concept:equivalence_relation "18.7.6 Concept equivalence_­relation [concept.equiv]"), *indirect-value-t*> &&[equivalence_relation](concept.equiv#concept:equivalence_relation "18.7.6 Concept equivalence_­relation [concept.equiv]"), iter_reference_t>; templateconcept [indirect_strict_weak_order](#concept:indirect_strict_weak_order "24.3.6.3 Indirect callables [indirectcallable.indirectinvocable]") =[indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept indirectly_­readable [iterator.concept.readable]") && [indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept indirectly_­readable [iterator.concept.readable]") &&[copy_constructible](concept.copyconstructible#concept:copy_constructible "18.4.14 Concept copy_­constructible [concept.copyconstructible]") &&[strict_weak_order](concept.strictweakorder#concept:strict_weak_order "18.7.7 Concept strict_­weak_­order [concept.strictweakorder]"), *indirect-value-t*> &&[strict_weak_order](concept.strictweakorder#concept:strict_weak_order "18.7.7 Concept strict_­weak_­order [concept.strictweakorder]"), iter_reference_t> &&[strict_weak_order](concept.strictweakorder#concept:strict_weak_order "18.7.7 Concept strict_­weak_­order [concept.strictweakorder]"), *indirect-value-t*> &&[strict_weak_order](concept.strictweakorder#concept:strict_weak_order "18.7.7 Concept strict_­weak_­order [concept.strictweakorder]"), iter_reference_t>;} #### [24.3.6.4](#projected) Alias template projected [[projected]](projected) [1](#projected-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.44 projection"))[.](#projected-1.sentence-1) It combines an [indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept 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.2 Concept indirectly_­readable [iterator.concept.readable]") type whose reference type is the result of applyingProj to the iter_reference_t of I[.](#projected-1.sentence-2) [🔗](#lib:projected) namespace std {templatestruct *projected-impl* { // *exposition only*struct *type* { // *exposition only*using value_type = remove_cvref_t>; using difference_type = iter_difference_t; // present only if I// models [weakly_incrementable](iterator.concept.winc#concept:weakly_incrementable "24.3.4.4 Concept weakly_­incrementable [iterator.concept.winc]") indirect_result_t operator*() const; // *not defined*}; }; template<[indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept indirectly_­readable [iterator.concept.readable]") I, [indirectly_regular_unary_invocable](#concept:indirectly_regular_unary_invocable "24.3.6.3 Indirect callables [indirectcallable.indirectinvocable]") Proj>using projected = *projected-impl*::*type*;}