title: How to deal with bad_alloc in RAII?
body: <p>The code is as follows:</p>
  
  <pre><code>class A;
  shared_ptr&lt;A&gt; aPtr(new A());
  //do something with aPtr.
  </code></pre>
  
  <p>If new throws a bad_alloc exception, what happend to the smart point aPtr? Do I need to do some check with aPtr, and how to do? And I know one of the Google C++ program rules is never using exceptions, but how they deal with exceptions like bad_alloc? Thank you for any replies. </p>