C++ Logo

std-proposals

Advanced search

Re: [std-proposals] noexcept has gotten a bit hairy -- I want a compiler error

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Mon, 5 May 2025 10:02:31 -0400
On Sun, May 4, 2025 at 2:45 PM Sebastian Wittmeier via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> - it works without check. The exception just wanders to the next level. At the same time we can be noexcept. That is fine.

The context of this conversation is such that `noexcept` has a
(completely) different meaning than it currently has. The OP wants the
compiler to statically verify that no exception throwing happens
*within* a `noexcept` function, not merely that the function itself
cannot allow an exception to pass through it. The point of the cast is
to take a function that isn't marked `noexcept` but will not throw and
tell the compiler that it's OK to call it in a `noexcept` function
(because the OP wants calls to non-noexcept functions to give an
error).

Now yes, this is a problem created only by the OP's insistence on
changing the fundamental meaning of keywords, but that is the core
context of this conversation.

Received on 2025-05-05 14:02:44