---
title: "Marking wide contract non-throwing functions noexcept is not controversial"
document: P4257R0
date: 2026-06-08
audience: LEWG
reply-to:
  - "Nevin “:-)” Liber <nliber@anl.gov>"
---

No syntax highlighting

Hide deleted text

# Revision History

## R0

First proposed.

# 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](https://wg21.link/n3279), eventually to become known as the Lakos Rule. One of its guidelines is:

- Each library function having a wide contract, that the LWG agree cannot throw, should be marked as unconditionally `noexcept`.

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.

# Policy Proposal

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

# 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.

# References

- [N3248](https://wg21.link/n3248) `noexcept` Prevents Library Validation
- [N3274](https://wg21.link/n3274) Minutes of WG21 Meeting, March 21, 2011
- [N3279](https://wg21.link/n3279) Conservative use of `noexcept` in the Library
- [P0884](https://wg21.link/p0884) Extending the `noexcept` Policy, Rev0
- [P1656](https://wg21.link/p1656) “Throws: Nothing” should be `noexcept`
- [P2837](https://wg21.link/p2837) Planning to Revisit the Lakos Rule
- [P2920](https://wg21.link/p2920) Library Evolution Leadership’s Understanding of the `noexcept` Policy History
- [P3005](https://wg21.link/p3005) Memorializing Principled-Design Policies for WG21
- [P3155](https://wg21.link/p3155) `noexcept` policy for SD-9 (The Lakos Rule)
- [P4254](https://wg21.link/p4254) Throwing Violation Handlers Are Post Hoc Library Design
