All challenges
Multiple ChoiceIntermediate 45s

Destructors are implicitly noexcept

By default, a destructor is implicitly `noexcept`. What is the practical implication if it may throw?
Options
  1. 1Nothing in practice; destructors may freely throw exceptions without any special consequence at runtime.
  2. 2You should declare it `noexcept(false)`, but throwing during stack unwinding still terminates the program.
  3. 3All destructors are always noexcept(true) and cannot be changed even with an explicit exception specification.
  4. 4The compiler inserts a try/catch around every destructor body and swallows any exception that escapes it.

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle