diff --git a/source/containers.tex b/source/containers.tex index d7032dfd28..4b9f9aed44 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -21034,7 +21034,7 @@ \indexheader{mdspan}% \begin{codeblock} -// all freestanding +// mostly freestanding namespace std { // \ref{mdspan.extents}, class template \tcode{extents} template @@ -21068,7 +21068,7 @@ // \ref{mdspan.mdspan}, class template \tcode{mdspan} template> - class mdspan; + class mdspan; // partially freestanding // \ref{mdspan.sub}, \tcode{submdspan} creation template @@ -24691,6 +24691,13 @@ template constexpr reference operator[](const array& indices) const; + template + constexpr reference at(OtherIndexTypes... indices) const; // freestanding-deleted + template + constexpr reference at(span indices) const; // freestanding-deleted + template + constexpr reference at(const array& indices) const; // freestanding-deleted + constexpr size_type size() const noexcept; constexpr bool empty() const noexcept; @@ -25139,6 +25146,67 @@ \end{codeblock} \end{itemdescr} +\indexlibrarymember{at}{mdspan}% +\begin{itemdecl} +template + constexpr reference at(OtherIndexTypes... indices) const; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\constraints +\begin{itemize} +\item +\tcode{(is_convertible_v \&\& ...)} is \tcode{true}, +\item +\tcode{(is_nothrow_constructible_v \&\& ...)} is \tcode{true}, and +\item +\tcode{sizeof...(OtherIndexTypes) == rank()} is \tcode{true}. +\end{itemize} + +\pnum +Let \tcode{I} be \tcode{extents_type::\exposid{index-cast}(std::move(indices))}. + +\pnum +\returns +\tcode{(*this)[I...]}. + +\pnum +\throws +\tcode{out_of_range} if \tcode{I} is not a multidimensional index in \tcode{extents()}. +\end{itemdescr} + +\indexlibrarymember{at}{mdspan}% +\begin{itemdecl} +template + constexpr reference at(span indices) const; +template + constexpr reference at(const array& indices) const; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\constraints +\begin{itemize} +\item +\tcode{is_convertible_v} is \tcode{true}, and +\item +\tcode{is_nothrow_constructible_v} is \tcode{true}. +\end{itemize} + +\pnum +\effects +Let \tcode{P} be a parameter pack such that +\begin{codeblock} +is_same_v, index_sequence> +\end{codeblock} +is \tcode{true}. +Equivalent to: +\begin{codeblock} +return at(extents_type::@\exposid{index-cast}@(as_const(indices[P]))...); +\end{codeblock} +\end{itemdescr} + \indexlibrarymember{size}{mdspan}% \begin{itemdecl} constexpr size_type size() const noexcept;