|
652 | 652 | #define @\defnlibxname{cpp_lib_erase_if}@ 202002L
|
653 | 653 | // also in \libheader{string}, \libheader{deque}, \libheader{forward_list}, \libheader{list}, \libheader{vector}, \libheader{map}, \libheader{set}, \libheader{unordered_map},
|
654 | 654 | // \libheader{unordered_set}
|
| 655 | +#define @\defnlibxname{cpp_lib_exception_ptr_cast}@ 202506L // also in \libheader{exception} |
655 | 656 | #define @\defnlibxname{cpp_lib_exchange_function}@ 201304L // freestanding, also in \libheader{utility}
|
656 | 657 | #define @\defnlibxname{cpp_lib_execution}@ 201902L // also in \libheader{execution}
|
657 | 658 | #define @\defnlibxname{cpp_lib_expected}@ 202211L // also in \libheader{expected}
|
|
3868 | 3869 | constexpr exception_ptr current_exception() noexcept;
|
3869 | 3870 | [[noreturn]] constexpr void rethrow_exception(exception_ptr p);
|
3870 | 3871 | template<class E> constexpr exception_ptr make_exception_ptr(E e) noexcept;
|
| 3872 | + template<class E> const E* exception_ptr_cast(const exception_ptr& p) noexcept; |
| 3873 | + template<class E> void exception_ptr_cast(const exception_ptr&&) = delete; |
3871 | 3874 |
|
3872 | 3875 | template<class T> [[noreturn]] constexpr void throw_with_nested(T&& t);
|
3873 | 3876 | template<class E> constexpr void rethrow_if_nested(const E& e);
|
|
4147 | 4150 | For purposes of determining the presence of a data race, operations on
|
4148 | 4151 | \tcode{exception_ptr} objects shall access and modify only the
|
4149 | 4152 | \tcode{exception_ptr} objects themselves and not the exceptions they refer to.
|
4150 |
| -Use of \tcode{rethrow_exception} on \tcode{exception_ptr} objects that refer to |
| 4153 | +Use of \tcode{rethrow_exception} or \tcode{exception_ptr_cast} |
| 4154 | +on \tcode{exception_ptr} objects that refer to |
4151 | 4155 | the same exception object shall not introduce a data race.
|
4152 | 4156 | \begin{note}
|
4153 | 4157 | If
|
|
4244 | 4248 | \end{note}
|
4245 | 4249 | \end{itemdescr}
|
4246 | 4250 |
|
| 4251 | +\indexlibraryglobal{exception_ptr_cast}% |
| 4252 | +\begin{itemdecl} |
| 4253 | +template<class E> const E* exception_ptr_cast(const exception_ptr& p) noexcept; |
| 4254 | +\end{itemdecl} |
| 4255 | + |
| 4256 | +\begin{itemdescr} |
| 4257 | +\pnum |
| 4258 | +\mandates |
| 4259 | +\tcode{E} is a cv-unqualified complete object type. |
| 4260 | +\tcode{E} is not an array type. |
| 4261 | +\tcode{E} is not a pointer or pointer-to-member type. |
| 4262 | +\begin{note} |
| 4263 | +When \tcode{E} is a pointer or pointer-to-member type, |
| 4264 | +a handler of type \tcode{const E\&} can match |
| 4265 | +without binding to the exception object itself. |
| 4266 | +\end{note} |
| 4267 | + |
| 4268 | +\pnum |
| 4269 | +\returns |
| 4270 | +A pointer to the exception object referred to by \tcode{p}, |
| 4271 | +if \tcode{p} is not null and |
| 4272 | +a handler of type \tcode{const E\&} |
| 4273 | +would be a match\iref{except.handle} for that exception object. |
| 4274 | +Otherwise, \tcode{nullptr}. |
| 4275 | +\end{itemdescr} |
| 4276 | + |
4247 | 4277 | \rSec2[except.nested]{\tcode{nested_exception}}
|
4248 | 4278 |
|
4249 | 4279 | \indexlibraryglobal{nested_exception}%
|
|
0 commit comments