Question.5
A developer throws an exception inside a destructor:
class FileWriter {
FILE* f;
public:
FileWriter() : f(fopen("log.txt","w")) {}
~FileWriter() {
if (fclose(f) != 0)
throw std::runtime_error("Close failed");
}
};What happens if the exception is thrown during stack unwinding (while another exception is being handled)?