title: Any workarounds for this MSVC specific vector<unordered_map<Trivial, NonCopyable>> bug?
body: <p>The following code does fail on MSVC but compiles on GCC and Clang, <a href="https://godbolt.org/z/eGc5cbGWo" rel="nofollow noreferrer">godbolt</a></p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;unordered_map&gt;
  #include &lt;vector&gt;
  using namespace std;
  
  struct NonCopyable
  {
      NonCopyable() = default;
      NonCopyable(NonCopyable const &amp;) = delete;
      NonCopyable(NonCopyable &amp;&amp;) = default;
  };
  
  int main()
  {
      using Data = unordered_map&lt;int, NonCopyable&gt;;
  
      vector&lt;Data&gt; vec;
  
      vec.reserve(3);     // error
      vec.resize(3);      // error
      vec.emplace_back(); // error
  
      return 0;
  }
  </code></pre>
  <p>This is the simplified version of the case I stumbled while working on my project. I was using MSVC from the beginning so I would prefer a workaround (if possible) rather than changing the compiler.</p>
  <p>As I understand from the error messages, <code>vector</code> tries to copy construct a <code>pair&lt;Trivial, NonCopyable&gt;</code>. Which,, it shouldn't,,, but there is no way I know of to tell it not to do that :/</p>
  <ul>
  <li>When <code>Data = map&lt;int, NonCopyable&gt;</code> MSVC fails with the same errors, while others compile.</li>
  <li>All compilers are fine if I use <code>Data = pair&lt;int, NonCopyable&gt;;</code> so the container trying to copy construct a pair might be the unorderd_map </li>
  <li>It works if I construct the vector with the correct size. However, I can not do that in my case.</li>
  </ul>
  <p>Thanks</p>