Embracing the **noexcept** Operator and Specifier *Safely*

By John Lakos

The noexcept operator, in concert with the noexcept specifier, enables generic code to choose a more efficient algorithm for types that have nonthrowing move and swap operations. These two C++11 features, which have continued to evolve with every release of the language since C++11, are important to high-performance computing yet, when overused, can profoundly jeopardize the maintainability of a large code base.

In this talk, we will explore what the noexcept keyword means, what it offers, how it can be used effectively, the potential pitfalls one can encounter (and how to avoid them), and some excruciating noexcept annoyances that exist in the C++ Standard today. Finally, we propose a fix for C++23 that will address several of the most egregious pitfalls and annoyances of these important features.

Background: Modern C++ offers a cornucopia of new features, not all of which are equally safe, especially when applied at scale. The material presented in this talk derives directly from our recently published book, Embracing Modern C++ Safely, wherein we categorize the features of modern C++ as safe, conditionally safe, or unsafe.

Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED

By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED

Settings can be changed at any time from the Cookie Policy page.