Marking wide contract non-throwing functions noexcept is not controversial

Document #: P4257R0 [Latest] [Status]
Date: 2026-06-08
Project: Programming Language C++
Audience: LEWG
Reply-to: Nevin “:-)” Liber
<>

1 Revision History

1.1 R0

First proposed.

2 Motivation and Scope

For C++11, LWG (there was no LEWG) was being very arbitrary about which non-throwing functions to mark noexcept.

Then in Madrid, the final meeting for technical work on C++11, along came N3279 Conservative use of noexcept in the Library, eventually to become known as the Lakos Rule. One of its guidelines is:

In Varna, we discovered that the Lakos Rule was never voted on as a policy past C++11.

Since then, there has been no policy regarding noexcept in the standard library.

In the discussions since then, it seems that all of the policy proposals have marking wide contract (no preconditions) non-throwing functions noexcept.

This is clearly better than the status quo of having no policy.

If we cannot come to consensus on anything else regarding noexcept, then we should at least attempt to come to consensus on this.

3 Policy Proposal

Policy: Each library function having a wide contract, that LEWG agree cannot throw, should be marked as unconditionally noexcept.

4 Acknowledgements

Thanks to John Lakos and Alisdair Meredith for initially bringing some sanity to marking functions noexcept.

Nevin Liber was supported by the Office of Science, U.S. Department of Energy, under contract DE-AC02-06CH11357.

5 References