Skip to content
Merged
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
32 changes: 31 additions & 1 deletion source/support.tex
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@
#define @\defnlibxname{cpp_lib_erase_if}@ 202002L
// also in \libheader{string}, \libheader{deque}, \libheader{forward_list}, \libheader{list}, \libheader{vector}, \libheader{map}, \libheader{set}, \libheader{unordered_map},
// \libheader{unordered_set}
#define @\defnlibxname{cpp_lib_exception_ptr_cast}@ 202506L // also in \libheader{exception}
#define @\defnlibxname{cpp_lib_exchange_function}@ 201304L // freestanding, also in \libheader{utility}
#define @\defnlibxname{cpp_lib_execution}@ 201902L // also in \libheader{execution}
#define @\defnlibxname{cpp_lib_expected}@ 202211L // also in \libheader{expected}
Expand Down Expand Up @@ -3864,6 +3865,8 @@
constexpr exception_ptr current_exception() noexcept;
[[noreturn]] constexpr void rethrow_exception(exception_ptr p);
template<class E> constexpr exception_ptr make_exception_ptr(E e) noexcept;
template<class E> const E* exception_ptr_cast(const exception_ptr& p) noexcept;
template<class E> void exception_ptr_cast(const exception_ptr&&) = delete;

template<class T> [[noreturn]] constexpr void throw_with_nested(T&& t);
template<class E> constexpr void rethrow_if_nested(const E& e);
Expand Down Expand Up @@ -4143,7 +4146,8 @@
For purposes of determining the presence of a data race, operations on
\tcode{exception_ptr} objects shall access and modify only the
\tcode{exception_ptr} objects themselves and not the exceptions they refer to.
Use of \tcode{rethrow_exception} on \tcode{exception_ptr} objects that refer to
Use of \tcode{rethrow_exception} or \tcode{exception_ptr_cast}
on \tcode{exception_ptr} objects that refer to
the same exception object shall not introduce a data race.
\begin{note}
If
Expand Down Expand Up @@ -4240,6 +4244,32 @@
\end{note}
\end{itemdescr}

\indexlibraryglobal{exception_ptr_cast}%
\begin{itemdecl}
template<class E> const E* exception_ptr_cast(const exception_ptr& p) noexcept;
\end{itemdecl}

\begin{itemdescr}
\pnum
\mandates
\tcode{E} is a cv-unqualified complete object type.
\tcode{E} is not an array type.
\tcode{E} is not a pointer or pointer-to-member type.
\begin{note}
When \tcode{E} is a pointer or pointer-to-member type,
a handler of type \tcode{const E\&} can match
without binding to the exception object itself.
\end{note}

\pnum
\returns
A pointer to the exception object referred to by \tcode{p},
if \tcode{p} is not null and
a handler of type \tcode{const E\&}
would be a match\iref{except.handle} for that exception object.
Otherwise, \tcode{nullptr}.
\end{itemdescr}

\rSec2[except.nested]{\tcode{nested_exception}}

\indexlibraryglobal{nested_exception}%
Expand Down