Is it possible to have two or more active exceptions at the same time? : <p>C++17 introduces a new function <a href="https://www.cs.helsinki.fi/group/boi2016/doc/cppreference/reference/en.cppreference.com/w/cpp/error/uncaught_exception.html" rel="noreferrer"><code>std::uncaught_exceptions</code></a>:</p>

<blockquote>
  <p>Detects how many exceptions have been thrown or rethrown and not yet
  entered their matching catch clauses.</p>
</blockquote>

<p>The following code:</p>

<pre><code>#include &lt;iostream&gt;

using namespace std;

struct A
{
    ~A()
    {
        cout &lt;&lt; std::uncaught_exceptions() &lt;&lt; endl;
    }
};

int main()
{
    try
    {
        try
        {

            A a1;
            throw 1;
        }
        catch (...)
        {
            A a2;
            throw;
        }
    }
    catch (...)
    {
        A a3;
    }   
}
</code></pre>

<p>outputs:</p>

<blockquote>
  <p>1</p>
  
  <p>1</p>
  
  <p>0</p>
</blockquote>

<p>Is it possible to have two or more active exceptions at the same time?</p>

<p>Is there any example?</p>
