Skip to content

Commit

Permalink
P2821R5 span.at()
Browse files Browse the repository at this point in the history
  • Loading branch information
burblebee committed Nov 15, 2023
1 parent ecbeb5a commit b145353
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -18315,6 +18315,7 @@

// \ref{span.elem}, element access
constexpr reference operator[](size_type idx) const;
constexpr reference at(size_type idx) const;
constexpr reference front() const;
constexpr reference back() const;
constexpr pointer data() const noexcept;
Expand Down Expand Up @@ -18806,6 +18807,21 @@
Equivalent to: \tcode{return *(data() + idx);}
\end{itemdescr}

\indexlibrarymember{span}{at}%
\begin{itemdecl}
constexpr reference at(size_type idx) const;
\end{itemdecl}

\begin{itemdescr}
\pnum
\returns
\tcode{*(data() + idx)}.

\pnum
\throws
\tcode{out_of_range} if \tcode{idx >= size()} is \tcode{true}.
\end{itemdescr}

\indexlibrarymember{span}{front}%
\begin{itemdecl}
constexpr reference front() const;
Expand Down
2 changes: 1 addition & 1 deletion source/support.tex
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@
#define @\defnlibxname{cpp_lib_smart_ptr_for_overwrite}@ 202002L // also in \libheader{memory}
#define @\defnlibxname{cpp_lib_smart_ptr_owner_equality}@ 202306L // also in \libheader{memory}
#define @\defnlibxname{cpp_lib_source_location}@ 201907L // freestanding, also in \libheader{source_location}
#define @\defnlibxname{cpp_lib_span}@ 202002L // also in \libheader{span}
#define @\defnlibxname{cpp_lib_span}@ 202311L // also in \libheader{span}
#define @\defnlibxname{cpp_lib_spanstream}@ 202106L // also in \libheader{spanstream}
#define @\defnlibxname{cpp_lib_ssize}@ 201902L // freestanding, also in \libheader{iterator}
#define @\defnlibxname{cpp_lib_sstream_from_string_view}@ 202306L // also in \libheader{sstream}
Expand Down

0 comments on commit b145353

Please sign in to comment.