title: What happens if I don't catch a throw?
body: <p>This is super basic but I can't find the answer anywhere. There's lots of posts out there about throwing and catching, but what actually happens if I <code>throw</code> from <code>function1</code> and then call <code>function1</code> from <code>function2</code> but don't catch it, does that mean it just gets rethrown to the caller of <code>function2</code>? Judging from the following I'd say yes, but I wanted to get a solid guru-like answer before I soldier on and assume:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  void function1()
  {
      throw 1;
  }
  
  void function2()
  {
      function1();
  }
  
  int main()
  {
      try
      {
          function2();
      }
      catch(...)
      {
          std::cout &lt;&lt; "caught!";
          return 0;
      }
      return 0;
  }
  </code></pre>
  
  <p><code>Output:
  caught!</code></p>