title: Why is std::unique_ptr::reset() always noexcept?
body: <p><a href="https://stackoverflow.com/questions/48849887/default-argument-vs-overloads-in-c/">A recent question</a> (and especially my answer to it) made me wonder:</p>
  
  <p>In C++11 (and newer standards), destructors are always implicitly <code>noexcept</code>, unless specified otherwise (i.e. <code>noexcept(false)</code>). In that case, these destructors may legally throw exceptions. (Note that this is still a <em>you should really know what you are doing</em>-kind of situation!) </p>
  
  <p>However, all overloads of
  <code>std::unique_ptr&lt;T&gt;::reset()</code> are declared to always be <code>noexcept</code> (see <a href="http://en.cppreference.com/w/cpp/memory/unique_ptr/reset" rel="noreferrer">cppreference</a>), even if the destructor if <code>T</code> isn't, resulting in program termination if a destructor throws an exception during <code>reset()</code>. Similar things apply to <code>std::shared_ptr&lt;T&gt;::reset()</code>.</p>
  
  <p><strong>Why is <code>reset()</code> always noexcept, and not conditionally noexcept?</strong> </p>
  
  <p>It should be possible to declare it <code>noexcept(noexcept(std::declval&lt;T&gt;().~T()))</code> which makes it noexcept exactly if the destructor of <code>T</code> is noexcept. Am I missing something here, or is this an oversight in the standard (since this is admittedly a highly academic situation)?</p>