title: When 'nested stack unwinding' is OK?
body: <p>AS I understand that we can not throw exceptions from dtor,
  and the reason is said like:
  &quot;if an exception was thrown inside 'stack unwinding', then there is no clear way to handle 'nested unwinding', thus 'throwing from dtor' is prohibited.&quot;.</p>
  <p>What makes me confuse is that, to obey above rule, we write codes like this:</p>
  <pre><code>#include &lt;stdexcept&gt;
  #include &lt;string&gt;
  #include &lt;stdio.h&gt;
  
  void some_cleanup_stuff_that_may_throw();
  
  class Bar
  {
  public:
      virtual ~Bar(){
          try {
              some_cleanup_stuff_that_may_throw();
          }
          catch (std::exception&amp; e){
              fprintf(stderr, &quot;Exception: %s from %s\n&quot;, e.what(), __FUNCTION__);
          }
      }
  
  };
  
  //{{ implementation of 'some_cleanup_stuff_that_may_throw'
  void level1();
  void level2();
  
  void some_cleanup_stuff_that_may_throw()
  {
      level1();
  }
  
  
  void level1()
  {
      level2();
  }
  
  void level2()
  {
      throw std::runtime_error(&quot;Yes thrown when stack unwinding&quot;);
  }
  
  //}} implementation of 'some_cleanup_stuff_that_may_throw'
  
  
  
  void Foo1()
  {
      Bar b1;
      throw std::runtime_error(&quot;Let's start stack unwinding&quot;);
  }
  
  int main()
  { 
      try {
          Foo1();
      }
      catch (std::exception&amp; e){
          fprintf(stderr, &quot;Exception: %s from %s\n&quot;, e.what(), __FUNCTION__);
      }
      return 0;
  }
  
  
  </code></pre>
  <p>So in some circumstance, 'nested stack unwinding' is possible.</p>
  <p>My question is: when 'nested stack unwinding' is 'OK' ?</p>