12 KiB
[special.mem.concepts]
26 Algorithms library [algorithms]
26.11 Specialized algorithms [specialized.algorithms]
26.11.2 Special memory concepts [special.mem.concepts]
Some algorithms in this subclause are constrained with the following exposition-only concepts:
template<class I> concept [nothrow-input-iterator](#concept:nothrow-input-iterator "26.11.2 Special memory concepts [special.mem.concepts]") = // exposition only [input_iterator](iterator.concept.input#concept:input_iterator "24.3.4.9 Concept input_iterator [iterator.concept.input]")<I> && is_lvalue_reference_v<iter_reference_t<I>> && [same_as](concept.same#concept:same_as "18.4.2 Concept same_as [concept.same]")<remove_cvref_t<iter_reference_t<I>>, iter_value_t<I>>;
A type I models nothrow-input-iterator only if no exceptions are thrown from increment, copy construction, move construction, copy assignment, move assignment, or indirection through valid iterators.
[Note 1:
This concept allows some input_iterator ([iterator.concept.input]) operations to throw exceptions.
â end note]
template<class S, class I> concept [nothrow-sentinel-for](#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") = [sentinel_for](iterator.concept.sentinel#concept:sentinel_for "24.3.4.7 Concept sentinel_for [iterator.concept.sentinel]")<S, I>; // exposition only
Types S and I model nothrow-sentinel-for only if no exceptions are thrown from copy construction, move construction, copy assignment, move assignment, or comparisons between valid values of type I and S.
[Note 2:
This concept allows some sentinel_for ([iterator.concept.sentinel]) operations to throw exceptions.
â end note]
template<class S, class I> concept [nothrow-sized-sentinel-for](#concept:nothrow-sized-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") = // exposition only [nothrow-sentinel-for](#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]")<S, I> && [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_sentinel_for [iterator.concept.sizedsentinel]")<S, I>;
Types S and I model nothrow-sized-sentinel-for only if no exceptions are thrown from the - operator for valid values of type I and S.
[Note 3:
This concept allows some sized_sentinel_for ([iterator.concept.sizedsentinel]) operations to throw exceptions.
â end note]
template<class R> concept [nothrow-input-range](#concept:nothrow-input-range "26.11.2 Special memory concepts [special.mem.concepts]") = // exposition only [range](range.range#concept:range "25.4.2 Ranges [range.range]")<R> && [nothrow-input-iterator](#concept:nothrow-input-iterator "26.11.2 Special memory concepts [special.mem.concepts]")<iterator_t<R>> && [nothrow-sentinel-for](#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]")<sentinel_t<R>, iterator_t<R>>;
A type R models nothrow-input-range only if no exceptions are thrown from calls to ranges::begin andranges::end on an object of type R.
template<class I> concept [nothrow-forward-iterator](#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") = // exposition only [nothrow-input-iterator](#concept:nothrow-input-iterator "26.11.2 Special memory concepts [special.mem.concepts]")<I> && [forward_iterator](iterator.concept.forward#concept:forward_iterator "24.3.4.11 Concept forward_iterator [iterator.concept.forward]")<I> && [nothrow-sentinel-for](#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]")<I, I>;
[Note 4:
This concept allows some forward_iterator ([iterator.concept.forward]) operations to throw exceptions.
â end note]
template<class R> concept [nothrow-forward-range](#concept:nothrow-forward-range "26.11.2 Special memory concepts [special.mem.concepts]") = // exposition only [nothrow-input-range](#concept:nothrow-input-range "26.11.2 Special memory concepts [special.mem.concepts]")<R> && [nothrow-forward-iterator](#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]")<iterator_t<R>>;
template<class I> concept [nothrow-bidirectional-iterator](#concept:nothrow-bidirectional-iterator "26.11.2 Special memory concepts [special.mem.concepts]") = // exposition only [nothrow-forward-iterator](#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]")<I> && [bidirectional_iterator](iterator.concept.bidir#concept:bidirectional_iterator "24.3.4.12 Concept bidirectional_iterator [iterator.concept.bidir]")<I>;
A type I models nothrow-bidirectional-iterator only if no exceptions are thrown from decrementing valid iterators.
[Note 5:
This concept allows some bidirectional_iterator ([iterator.concept.bidir]) operations to throw exceptions.
â end note]
template<class R> concept [nothrow-bidirectional-range](#concept:nothrow-bidirectional-range "26.11.2 Special memory concepts [special.mem.concepts]") = // exposition only [nothrow-forward-range](#concept:nothrow-forward-range "26.11.2 Special memory concepts [special.mem.concepts]")<R> && [nothrow-bidirectional-iterator](#concept:nothrow-bidirectional-iterator "26.11.2 Special memory concepts [special.mem.concepts]")<iterator_t<R>>;
template<class I> concept [nothrow-random-access-iterator](#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") = // exposition only [nothrow-bidirectional-iterator](#concept:nothrow-bidirectional-iterator "26.11.2 Special memory concepts [special.mem.concepts]")<I> && [random_access_iterator](iterator.concept.random.access#concept:random_access_iterator "24.3.4.13 Concept random_access_iterator [iterator.concept.random.access]")<I> && [nothrow-sized-sentinel-for](#concept:nothrow-sized-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]")<I, I>;
A type I models nothrow-random-access-iterator only if no exceptions are thrown from comparisons of valid iterators, or the -, +, -=, +=, [] operators on valid values of type I and iter_difference_t.
[Note 6:
This concept allows some random_access_iterator ([iterator.concept.random.access]) operations to throw exceptions.
â end note]
`template concept nothrow-random-access-range = // exposition only nothrow-bidirectional-range && nothrow-random-access-iterator<iterator_t>;
template concept nothrow-sized-random-access-range = // exposition only nothrow-random-access-range && sized_range; `
A type R models nothrow-sized-random-access-range only if no exceptions are thrown from the call to ranges::size on an object of type R.