title: The MSVC compiler thinks I am referencing a deleted function but as far as I can tell, I am not
body: <p>I have the following program:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  class Foo
  {
  public:
  
      Foo()
      {
          std::cout &lt;&lt; "Default constructor" &lt;&lt; std::endl;
      }
  
      Foo(const Foo &amp;)
      {
          std::cout &lt;&lt; "Copy constructor" &lt;&lt; std::endl;
      }
  
      void operator=(const Foo &amp;)
      {
          std::cout &lt;&lt; "Asign operator" &lt;&lt; std::endl;
      }
  };
  
  int main()
  {
      auto f = Foo{};
  
      std::cin.get();
  }
  </code></pre>
  
  <p>When I run this, the output is "Default constructor" and nothing else so I know that the only thing being called is the default constructor.</p>
  
  <p>However if I change the class to this:</p>
  
  <pre><code>class Foo
  {
  public:
  
      Foo()
      {
          std::cout &lt;&lt; "Default constructor" &lt;&lt; std::endl;
      }
  
      Foo(const Foo &amp;) = delete;
  
      void operator=(const Foo &amp;) = delete;
  };
  </code></pre>
  
  <p>The code will now fail to compile with this error:
  <a href="https://i.stack.imgur.com/RFTFb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RFTFb.png" alt="The error message"></a></p>
  
  <p>The code will compile if I change the variable declaration to <code>Foo f{};</code>. Is there a way I can use the first style or is this just a thing I have to deal with?</p>