ฉันเห็นว่ามีคำตอบมากมายที่โพสต์ที่นี่ซึ่งจะตกอยู่ในกรณีผู้โชคดีที่จะได้งานทำ แต่ไม่มีใครกำหนดได้ว่าจะขัดข้อง 100% บางส่วนจะมีปัญหากับฮาร์ดแวร์และระบบปฏิบัติการเดียวส่วนอื่น ๆ จะไม่ทำงาน อย่างไรก็ตามมีวิธีมาตรฐานตามมาตรฐาน C ++ อย่างเป็นทางการเพื่อให้เกิดความผิดพลาด
ข้อความอ้างอิงจากC ++ มาตรฐานISO / IEC 14882 §15.1-7 :
  หากกลไกการจัดการข้อยกเว้นหลังจากเสร็จสิ้นการเริ่มต้นของวัตถุยกเว้น แต่ก่อนที่การเปิดใช้งานของตัวจัดการข้อยกเว้นเรียกใช้ฟังก์ชันที่ออกจากข้อยกเว้น std :: ยุติจะถูกเรียก (15.5.1)
struct C {
    C() { }
    C(const C&) {
        if (std::uncaught_exceptions()) {
            throw 0; // throw during copy to handler’s exception-declaration object (15.3)
        }
    }
};
int main() {
    try {
    throw C(); // calls std::terminate() if construction of the handler’s
    // exception-declaration object is not elided (12.8)
    } catch(C) { }
}
ฉันได้เขียนโค้ดขนาดเล็กที่จะแสดงให้เห็นถึงนี้และสามารถพบและพยายามIdeone ที่นี่
class MyClass{
    public:
    ~MyClass() throw(int) { throw 0;}
};
int main() {
  try {
    MyClass myobj; // its destructor will cause an exception
    // This is another exception along with exception due to destructor of myobj and will cause app to terminate
     throw 1;      // It could be some function call which can result in exception.
  }
  catch(...)
  {
    std::cout<<"Exception catched"<<endl;
  }
  return 0;
}
ISO / IEC 14882 §15.1 / 9กล่าวถึงการโยนโดยไม่ลองบล็อกทำให้การโทรโดยปริยาย:
  หากไม่มีข้อยกเว้นอยู่ในขณะนี้การจัดการการดำเนินการการแสดงออกโดยไม่มีตัวถูกดำเนินการเรียก std :: ยุติ ()
คนอื่น ๆ รวมถึง: โยนจาก destructor: ISO / IEC 14882 §15.2 / 3
               
              
asm { cli; };