Question 14
Back to Exercise
What happens if an exception escapes a function declared noexcept?
- A The exception propagates normally
- B std::terminate is called and the program ends Correct
- C The exception is silently ignored
- D Compilation fails
Correct Answer: Option B
noexcept is a promise; breaking it terminates the program. In exchange, callers and containers can skip exception handling for such calls.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!