C++ Logo

std-proposals

Advanced search

Re: [std-proposals] noexcept(override) and maybe noexcept(auto)?

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Fri, 23 Aug 2024 11:25:46 +0300
On Fri, 23 Aug 2024 at 11:18, Jens Maurer via Std-Proposals
<std-proposals_at_[hidden]> wrote:

> > I also think that a `noexcept(auto)` or just simply having an implicit noexcept on inline/constexpr function if all calls inside the function are noexcept would be nice to have as well, due to the fact that sometimes we do specific stuff based upon the exception specifier to have certain exception guarantees that we can skip if everything we are dependent on is noexcept. The compiler should be able to check all operations and function-calls inside a function to determine what exception specification could be used, where we can specify things manually if we somehow can make certain guarantees as well.
>
> We had noexcept(auto) proposal(s) in the past that went nowhere.
> I have no details to offer, though.

I have some, being the author for a couple of noexcept(auto) papers.
There was resistance to the facility due to concerns
about unintended interface changes, and I stopped pursuing it due to
overall lack of truly motivating use cases.

However, it's being proposed again, because of new motivating use
cases for asynchronous programming. There
is
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3166r0.html#org8639d71
and
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3166r0.html#orge1e9733
that are highly related, even pertinent.

I do not recall earlier discussions of the facility depicted in this
discussion as noexcept(override).

Received on 2024-08-23 08:26:04