Skip to content

Commit 6faa9cf

Browse files
Dawn Perchikzygoloid
authored andcommitted
LWG3320 span::cbegin/cend methods produce different results than std::[ranges::]cbegin/cend
Also fixes NB PL 247 (C++20 CD).
1 parent 41e73c4 commit 6faa9cf

File tree

1 file changed

+5
-59
lines changed

1 file changed

+5
-59
lines changed

source/containers.tex

Lines changed: 5 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -10568,9 +10568,7 @@
1056810568
using reference = element_type&;
1056910569
using const_reference = const element_type&;
1057010570
using iterator = @\impdefx{type of \tcode{span::iterator}}@; // see \ref{span.iterators}
10571-
using const_iterator = @\impdefx{type of \tcode{span::const_iterator}}@;
1057210571
using reverse_iterator = std::reverse_iterator<iterator>;
10573-
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
1057410572
static constexpr size_type extent = Extent;
1057510573

1057610574
// \ref{span.cons}, constructors, copy, and assignment
@@ -10622,12 +10620,8 @@
1062210620
// \ref{span.iterators}, iterator support
1062310621
constexpr iterator begin() const noexcept;
1062410622
constexpr iterator end() const noexcept;
10625-
constexpr const_iterator cbegin() const noexcept;
10626-
constexpr const_iterator cend() const noexcept;
1062710623
constexpr reverse_iterator rbegin() const noexcept;
1062810624
constexpr reverse_iterator rend() const noexcept;
10629-
constexpr const_reverse_iterator crbegin() const noexcept;
10630-
constexpr const_reverse_iterator crend() const noexcept;
1063110625

1063210626
private:
1063310627
pointer data_; // \expos
@@ -11119,23 +11113,21 @@
1111911113
\rSec3[span.iterators]{Iterator support}
1112011114

1112111115
\indexlibrarymember{iterator}{span}%
11122-
\indexlibrarymember{const_iterator}{span}%
1112311116
\begin{itemdecl}
1112411117
using iterator = @\impdefx{type of \tcode{span::iterator}}@;
11125-
using const_iterator = @\impdefx{type of \tcode{span::const_iterator}}@;
1112611118
\end{itemdecl}
1112711119

1112811120
\begin{itemdescr}
1112911121
\pnum
11130-
The types
11131-
model \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous},
11132-
meet the \oldconcept{RandomAccessIterator}
11122+
The type
11123+
models \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous},
11124+
meets the \oldconcept{RandomAccessIterator}
1113311125
requirements\iref{random.access.iterators},
1113411126
and
11135-
meet the requirements for
11127+
meets the requirements for
1113611128
constexpr iterators\iref{iterator.requirements.general}.
1113711129
All requirements on container iterators\iref{container.requirements} apply to
11138-
\tcode{span::iterator} and \tcode{span::const_iterator} as well.
11130+
\tcode{span::iterator} as well.
1113911131
\end{itemdescr}
1114011132

1114111133
\indexlibrarymember{span}{begin}%
@@ -11184,52 +11176,6 @@
1118411176
Equivalent to: \tcode{return reverse_iterator(begin());}
1118511177
\end{itemdescr}
1118611178

11187-
\indexlibrarymember{span}{cbegin}%
11188-
\begin{itemdecl}
11189-
constexpr const_iterator cbegin() const noexcept;
11190-
\end{itemdecl}
11191-
11192-
\begin{itemdescr}
11193-
\pnum
11194-
\returns
11195-
A constant iterator referring to the first element in the span.
11196-
If \tcode{empty()} is \tcode{true}, then it returns the same value
11197-
as \tcode{cend()}.
11198-
\end{itemdescr}
11199-
11200-
\indexlibrarymember{span}{cend}%
11201-
\begin{itemdecl}
11202-
constexpr const_iterator cend() const noexcept;
11203-
\end{itemdecl}
11204-
11205-
\begin{itemdescr}
11206-
\pnum
11207-
\returns
11208-
A constant iterator which is the past-the-end value.
11209-
\end{itemdescr}
11210-
11211-
\indexlibrarymember{span}{crbegin}%
11212-
\begin{itemdecl}
11213-
constexpr const_reverse_iterator crbegin() const noexcept;
11214-
\end{itemdecl}
11215-
11216-
\begin{itemdescr}
11217-
\pnum
11218-
\effects
11219-
Equivalent to: \tcode{return const_reverse_iterator(cend());}
11220-
\end{itemdescr}
11221-
11222-
\indexlibrarymember{span}{crend}%
11223-
\begin{itemdecl}
11224-
constexpr const_reverse_iterator crend() const noexcept;
11225-
\end{itemdecl}
11226-
11227-
\begin{itemdescr}
11228-
\pnum
11229-
\effects
11230-
Equivalent to: \tcode{return const_reverse_iterator(cbegin());}
11231-
\end{itemdescr}
11232-
1123311179

1123411180
\rSec3[span.objectrep]{Views of object representation}
1123511181

0 commit comments

Comments
 (0)