title: Finding where a deleted function is referenced
body: <p>IDE - Visual Studio Express 2013 for Desktop</p>
  
  <p>C++11</p>
  
  <p>Problem - I have a class which is apparently being copied (using copy constructor). If I declare the copy constructor like this:</p>
  
  <pre><code>MyClass(const MyClass&amp;) = delete;
  </code></pre>
  
  <p>It complains about a reference to a deleted function. I have gone over my entire code twice now and cannot find where an instance of the class would be copied.</p>
  
  <p>Is there any way to find where the reference comes from?</p>
  
  <p>I have tried defining the copy constructor, with a breakpoint in it, but it is never hit.</p>
  
  <h1>Update</h1>
  
  <p>Sorry it actually does show where the reference is - in some allocator in the STL. I managed to track it down to a std::vector::emplace_back() call - which must cause a copy. I will investigate this.</p>
  
  <h2>Update 2</h2>
  
  <p>I'm such a dumbass - I had a vector of MyClass...</p>