Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 43 additions & 17 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10669,20 +10669,20 @@
// \ref{span.cons}, constructors, copy, and assignment
constexpr span() noexcept;
template<class It>
constexpr span(It first, size_type count);
constexpr explicit(extent != dynamic_extent) span(It first, size_type count);
template<class It, class End>
constexpr span(It first, End last);
constexpr explicit(extent != dynamic_extent) span(It first, End last);
template<size_t N>
constexpr span(type_identity_t<element_type> (&arr)[N]) noexcept;
template<class T, size_t N>
constexpr span(array<T, N>& arr) noexcept;
template<class T, size_t N>
constexpr span(const array<T, N>& arr) noexcept;
template<class R>
constexpr span(R&& r);
constexpr explicit(extent != dynamic_extent) span(R&& r);
constexpr span(const span& other) noexcept = default;
template<class OtherElementType, size_t OtherExtent>
constexpr span(const span<OtherElementType, OtherExtent>& s) noexcept;
constexpr explicit(@\seebelow@) span(const span<OtherElementType, OtherExtent>& s) noexcept;

~span() noexcept = default;

Expand Down Expand Up @@ -10760,7 +10760,7 @@
\indexlibraryctor{span}%
\begin{itemdecl}
template<class It>
constexpr span(It first, size_type count);
constexpr explicit(extent != dynamic_extent) span(It first, size_type count);
\end{itemdecl}

\begin{itemdescr}
Expand Down Expand Up @@ -10800,7 +10800,7 @@
\indexlibraryctor{span}%
\begin{itemdecl}
template<class It, class End>
constexpr span(It first, End last);
constexpr explicit(extent != dynamic_extent) span(It first, End last);
\end{itemdecl}

\begin{itemdescr}
Expand Down Expand Up @@ -10850,9 +10850,14 @@
\begin{itemdescr}
\pnum
\constraints
Let \tcode{U} be \tcode{remove_pointer_t<decltype(data(arr))>}.
\begin{itemize}
\item \tcode{extent == dynamic_extent || N == extent} is \tcode{true}, and
\item \tcode{remove_pointer_t<decltype(data(arr))>(*)[]} is convertible to \tcode{ElementType(*)[]}.
\item \tcode{is_convertible_v<U(*)[], element_type(*)[]>} is \tcode{true}.
\begin{note}
The intent is to allow only qualification conversions
of the array element type to \tcode{element_type}.
\end{note}
\end{itemize}

\pnum
Expand All @@ -10869,15 +10874,14 @@

\indexlibraryctor{span}%
\begin{itemdecl}
template<class R> constexpr span(R&& r);
template<class R> constexpr explicit(extent != dynamic_extent) span(R&& r);
\end{itemdecl}

\begin{itemdescr}
\pnum
\constraints
Let \tcode{U} be \tcode{remove_reference_t<ranges::range_reference_t<R>>}.
\begin{itemize}
\item \tcode{extent == dynamic_extent} is \tcode{true}.
\item \tcode{R} satisfies \tcode{ranges::\libconcept{contiguous_range}} and
\tcode{ranges::\libconcept{sized_range}}.
\item Either \tcode{R} satisfies \tcode{ranges::\libconcept{borrowed_range}} or
Expand All @@ -10889,13 +10893,15 @@
\tcode{is_convertible_v<U(*)[], element_type(*)[]>} is \tcode{true}.
\begin{note}
The intent is to allow only qualification conversions
of the iterator reference type to \tcode{element_type}.
of the range reference type to \tcode{element_type}.
\end{note}
\end{itemize}

\pnum
\expects
\begin{itemize}
\item If \tcode{extent} is not equal to \tcode{dynamic_extent},
then \tcode{ranges::size(r)} is equal to \tcode{extent}.
\item \tcode{R} models \tcode{ranges::\libconcept{contiguous_range}} and
\tcode{ranges::\libconcept{sized_range}}.
\item If \tcode{is_const_v<element_type>} is \tcode{false},
Expand Down Expand Up @@ -10926,17 +10932,26 @@
\indexlibraryctor{span}%
\begin{itemdecl}
template<class OtherElementType, size_t OtherExtent>
constexpr span(const span<OtherElementType, OtherExtent>& s) noexcept;
constexpr explicit(@\seebelow@) span(const span<OtherElementType, OtherExtent>& s) noexcept;
\end{itemdecl}

\begin{itemdescr}
\pnum
\constraints
\begin{itemize}
\item \tcode{Extent == dynamic_extent || Extent == OtherExtent} is \tcode{true}, and
\item \tcode{OtherElementType(*)[]} is convertible to \tcode{ElementType(*)[]}.
\item \tcode{extent == dynamic_extent} \tcode{||} \tcode{OtherExtent == dynamic_extent} \tcode{||} \tcode{extent == OtherExtent} is \tcode{true}, and
\item \tcode{is_convertible_v<OtherElementType(*)[], element_type(*)[]>} is \tcode{true}.
\begin{note}
The intent is to allow only qualification conversions
of the \tcode{OtherElementType} to \tcode{element_type}.
\end{note}
\end{itemize}

\pnum
\expects
If \tcode{extent} is not equal to \tcode{dynamic_extent},
then \tcode{s.size()} is equal to \tcode{extent}.

\pnum
\effects
Constructs a \tcode{span} that is a view over the range
Expand All @@ -10945,6 +10960,13 @@
\pnum
\ensures
\tcode{size() == s.size() \&\& data() == s.data()}.

\pnum
\remarks
The expression inside \tcode{explicit} is equivalent to:
\begin{codeblock}
extent != dynamic_extent && OtherExtent == dynamic_extent
\end{codeblock}
\end{itemdescr}

\indexlibrarymember{operator=}{span}%
Expand Down Expand Up @@ -11002,7 +11024,8 @@

\pnum
\effects
Equivalent to: \tcode{return \{data(), Count\};}
Equivalent to: \tcode{return R\{data(), Count\};}
where \tcode{R} is the return type.
\end{itemdescr}

\indexlibrarymember{span}{last}%
Expand All @@ -11021,7 +11044,8 @@

\pnum
\effects
Equivalent to: \tcode{return \{data() + (size() - Count), Count\};}
Equivalent to: \tcode{return R\{data() + (size() - Count), Count\};}
where \tcode{R} is the return type.
\end{itemdescr}

\indexlibrarymember{span}{subspan}%
Expand Down Expand Up @@ -11287,7 +11311,8 @@
\begin{itemdescr}
\pnum
\effects
Equivalent to: \tcode{return \{reinterpret_cast<const byte*>(s.data()), s.size_bytes()\};}
Equivalent to: \tcode{return R\{reinterpret_cast<const byte*>(s.data()), s.size_bytes()\};}
where \tcode{R} is the return type.
\end{itemdescr}

\indexlibraryglobal{as_writable_bytes}%
Expand All @@ -11304,7 +11329,8 @@

\pnum
\effects
Equivalent to: \tcode{return \{reinterpret_cast<byte*>(s.data()), s.size_bytes()\};}
Equivalent to: \tcode{return R\{reinterpret_cast<byte*>(s.data()), s.size_bytes()\};}
where \tcode{R} is the return type.
\end{itemdescr}

\rSec3[span.tuple]{Tuple interface}
Expand Down
2 changes: 1 addition & 1 deletion source/support.tex
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@
#define @\defnlibxname{cpp_lib_shift}@ 201806L // also in \libheader{algorithm}
#define @\defnlibxname{cpp_lib_smart_ptr_default_init}@ 201811L // also in \libheader{memory}
#define @\defnlibxname{cpp_lib_source_location}@ 201907L // also in \libheader{source_location}
#define @\defnlibxname{cpp_lib_span}@ 201902L // also in \libheader{span}
#define @\defnlibxname{cpp_lib_span}@ 202002L // also in \libheader{span}
#define @\defnlibxname{cpp_lib_ssize}@ 201902L // also in \libheader{iterator}
#define @\defnlibxname{cpp_lib_starts_ends_with}@ 201711L // also in \libheader{string}, \libheader{string_view}
#define @\defnlibxname{cpp_lib_string_udls}@ 201304L // also in \libheader{string}
Expand Down