title: How do I find the culprit code that is making C++ list give me 'attempting to reference a deleted function' error with MSVC 14.20.27508?
body: <p>I have been porting my code from Visual Studio 2017 to Visual Studio 2019. It was building properly before. But now I am getting these errors:</p>
  
  <pre><code>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.20.27508\include\list(1010): error C2280: 'std::pair&lt;_Kty,_Ty&gt; &amp;std::pair&lt;_Kty,_Ty&gt;::operator =(volatile const std::pair&lt;_Kty,_Ty&gt; &amp;)': attempting to reference a deleted function        178 114
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.20.27508\include\list(1010): error C2280: 'std::pair&lt;_Kty,_Ty&gt; &amp;std::pair&lt;_Kty,_Ty&gt;::operator =(volatile const std::pair&lt;_Kty,_Ty&gt; &amp;)': attempting to reference a deleted function        54  114
  </code></pre>
  
  <p>These errors do not refer to lines in my code, so I can't see what I have written that might cause them. And this code built without error in earlier versions of the tools.</p>
  
  <p>Here are the project properties of the failing build:</p>
  
  <p><a href="https://i.stack.imgur.com/LFaGI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LFaGI.png" alt="https://imgur.com/a/WnjmKRa"></a> </p>
  
  <p>Note: most of the projects are building fine.</p>
  
  <p>With <strong>Windows SDK Version</strong> set to <strong>7.0</strong> and <strong>Platform Toolset</strong> set to <strong>Visual Studio 2017 - Windows XP (v141_xp)</strong> the same project builds successfully. <a href="https://i.stack.imgur.com/HGV32.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HGV32.png" alt="Snapshot showing that the project built fine with Windows SDK version 7 and Toolset v141_xp"></a></p>
  
  <p>I understand there is a problem in my code, somewhere, but it is not showing any error in any code that belongs to the project I am building, it is only showing the error in the <code>list</code> header. </p>
  
  <p>I want to find the culprit code that is causing this build failure.
  What scenarios would make <code>list</code> give me these errors? </p>
  
  <p>Why does it build fine with Windows SDK 7 and v141_xp toolset and, not with upgraded SDK and toolset?</p>