83 lines
2.6 KiB
Markdown
83 lines
2.6 KiB
Markdown
[span.iterators]
|
||
|
||
# 23 Containers library [[containers]](./#containers)
|
||
|
||
## 23.7 Views [[views]](views#span.iterators)
|
||
|
||
### 23.7.2 Contiguous access [[views.contiguous]](views.contiguous#span.iterators)
|
||
|
||
#### 23.7.2.2 Class template span [[views.span]](views.span#span.iterators)
|
||
|
||
#### 23.7.2.2.7 Iterator support [span.iterators]
|
||
|
||
[ð](#lib:iterator,span)
|
||
|
||
`using iterator = implementation-defined;
|
||
`
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L20893)
|
||
|
||
The type
|
||
models [contiguous_iterator](iterator.concept.contiguous#concept:contiguous_iterator "24.3.4.14 Concept contiguous_iterator [iterator.concept.contiguous]") ([[iterator.concept.contiguous]](iterator.concept.contiguous "24.3.4.14 Concept contiguous_iterator")),
|
||
meets the *Cpp17RandomAccessIterator* requirements ([[random.access.iterators]](random.access.iterators "24.3.5.7 Random access iterators")),
|
||
and
|
||
meets the requirements for
|
||
constexpr iterators ([[iterator.requirements.general]](iterator.requirements.general "24.3.1 General")),
|
||
whose value type is value_type and
|
||
whose reference type is reference[.](#1.sentence-1)
|
||
|
||
[2](#2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L20904)
|
||
|
||
All requirements on container iterators ([[container.reqmts]](container.reqmts "23.2.2.2 Container requirements")) apply tospan::iterator as well[.](#2.sentence-1)
|
||
|
||
[ð](#lib:span,begin)
|
||
|
||
`constexpr iterator begin() const noexcept;
|
||
`
|
||
|
||
[3](#3)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L20915)
|
||
|
||
*Returns*: An iterator referring to the first element in the span[.](#3.sentence-1)
|
||
|
||
If empty() is true, then it returns the
|
||
same value as end()[.](#3.sentence-2)
|
||
|
||
[ð](#lib:span,end)
|
||
|
||
`constexpr iterator end() const noexcept;
|
||
`
|
||
|
||
[4](#4)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L20928)
|
||
|
||
*Returns*: An iterator which is the past-the-end value[.](#4.sentence-1)
|
||
|
||
[ð](#lib:span,rbegin)
|
||
|
||
`constexpr reverse_iterator rbegin() const noexcept;
|
||
`
|
||
|
||
[5](#5)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L20939)
|
||
|
||
*Effects*: Equivalent to: return reverse_iterator(end());
|
||
|
||
[ð](#lib:span,rend)
|
||
|
||
`constexpr reverse_iterator rend() const noexcept;
|
||
`
|
||
|
||
[6](#6)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L20950)
|
||
|
||
*Effects*: Equivalent to: return reverse_iterator(begin());
|