title: Can I force a default special member function to be noexcept?
body: <p>The following structure fails to compile under C++11 due to the fact that I have declared the move assignment operator as <code>noexcept</code>:</p>
  
  <pre><code>struct foo
  {
    std::vector&lt;int&gt; data;
    foo&amp; operator=(foo&amp;&amp;) noexcept = default;
  };
  </code></pre>
  
  <p>The default move assignment operator generated by the compiler is <code>noexcept(false)</code> due to the fact that <code>std::vector&lt;int&gt;</code>'s move assignment is also <code>noexcept(false)</code>.  This in turn is due to the fact that the default allocator has <code>std::allocator_traits&lt;T&gt;:: propagate_on_container_move_assignment</code> set to <code>std::false_type</code>.  See also <a href="https://stackoverflow.com/questions/12332772/why-arent-container-move-assignment-operators-noexcept">this question</a>.</p>
  
  <p>I believe this has been fixed in C++14 (see <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2103" rel="nofollow noreferrer">library defect 2103</a>).</p>
  
  <p>My question is, is there a way for me to force <code>noexcept</code> upon the default move assignment assignment operator without having to define it myself?</p>
  
  <p>If this is not possible, is there a way I can trick the <code>std::vector&lt;int&gt;</code> into being <code>noexcept</code> move assignable so that <code>noexcept(true)</code> is passed through to my struct?</p>