title: C++ Exception handling without try
body: <p>I am currently trying to write a function for a specific type of <strong>hardware exception handling</strong>. </p>
  
  <p>The program should test, whether a certain condition is true and start a short emergency procedure and finally terminate.</p>
  
  <p>This test will have to be done quite often and should be rather quick. </p>
  
  <p>Further, it is implemented in a project without any further exception handling.</p>
  
  <p>Therefore, putting <code>try</code> statements everywhere is not really an option. </p>
  
  <p>Ideally, such a function would look like this:</p>
  
  <pre><code>void CheckForException(){
    if (Condition == true){
      cout &lt;&lt; "The chosen configuration is very dangerous, do something different!" &lt;&lt; endl;
  
      someHardwareFunction();
  
      someStatementEndingTheProgram;
    }
  }
  </code></pre>
  
  <p>In principle, I am looking for <code>someStatementEndingTheProgram</code>. </p>
  
  <p>I figured, end(), terminate() and the like are bad style.</p>
  
  <p>Could a <code>throw</code> statement without a <code>try</code> work in this case?</p>