Understanding noexcept semantics in C++
This is a fundamental C++ language-knowledge question that tests whether a candidate understands the contract and runtime behaviour of the noexcept specifier. It's a common screening question at firms that rely on C++ for low-latency systems, where exception safety guarantees are critical to system stability.
The question probes the distinction between what the language permits at compile time and what actually happens at runtime when that contract is violated. A strong answer requires clarity on both the compiler's interpretation of the specifier and the standard library's response to a breach. This is especially important in trading and infrastructure roles, where unexpected termination can be costly.
- Compile-time vs. runtime semantics of noexcept
- Exception specifications and their enforcement
- Impact on optimisation and unwinding
- std::terminate and program flow