noexceptsafe
noexceptsafe is a C++ keyword introduced in C++20 that provides a mechanism to mark functions whose execution will not throw exceptions. It is a more powerful and expressive alternative to the noexcept specifier. Unlike noexcept, which can lead to undefined behavior if a function marked noexcept throws an exception, noexceptsafe guarantees that if a function marked noexceptsafe throws, the program will be terminated in a controlled manner via std::terminate. This allows for safer exception handling in situations where exception propagation is not desired or expected.
The primary benefit of noexceptsafe is enhanced safety and predictability. When a function is declared noexceptsafe,
noexceptsafe can be applied to functions, lambdas, and member functions. It is particularly useful for functions