Date: Fri, 9 May 2025 10:29:55 +0100
On Fri, 9 May 2025 at 08:41, Filip via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> Just a thought but I would like to have some level of mandatory usage of noexcept.
>
> Why isn’t it mandatory to mark function that has throw statement with noexcept(false)?
Because it would be a massive breaking change, and the throw statement
might be conditional (e.g. depend on preprocessor macros, or
platform-specific properties, or template arguments ... only the last
of those is convenient to put in a conditional noexcept-specifier).
> Then it would be very clear what to look for.
That doesn't seem like a great rationale for breaking millions of lines of code.
> I would like to be explicit with maybe try keyword that could be used to mark a function that throws as automatically rethrowing.
> In my experience it would greatly reduce the time it takes to look for exception handling.
<std-proposals_at_[hidden]> wrote:
>
> Just a thought but I would like to have some level of mandatory usage of noexcept.
>
> Why isn’t it mandatory to mark function that has throw statement with noexcept(false)?
Because it would be a massive breaking change, and the throw statement
might be conditional (e.g. depend on preprocessor macros, or
platform-specific properties, or template arguments ... only the last
of those is convenient to put in a conditional noexcept-specifier).
> Then it would be very clear what to look for.
That doesn't seem like a great rationale for breaking millions of lines of code.
> I would like to be explicit with maybe try keyword that could be used to mark a function that throws as automatically rethrowing.
> In my experience it would greatly reduce the time it takes to look for exception handling.
Received on 2025-05-09 09:30:12