Intermediate C++
Q60 / 100

What does the noexcept specifier do?

Correct! Well done.

Incorrect.

The correct answer is A) Prevents exceptions from being thrown; any exception causes std::terminate

A

Correct Answer

Prevents exceptions from being thrown; any exception causes std::terminate

Explanation

void f() noexcept; guarantees no exception escapes. If one does, std::terminate is called. noexcept enables compiler optimizations, especially for move operations.

Progress
60/100