title: What function does C++ write and call in an empty class?
body: <p>In the book <em>Effective C++</em>, I saw the passage below:</p>
  
  <blockquote>
    <p>As a result, if you write   </p>
  
  <pre><code>class Empty{};
  </code></pre>
    
    <p>it's essentially the same as if you'd written this:  </p>
  
  <pre><code>class Empty {
  public:
      Empty() { ... }
      Empty(const Empty&amp; rhs) { ... }
      ~Empty() { ... }
      Empty&amp; operator=(const Empty&amp; rhs) { ... } // copy assignment operator
  };
  </code></pre>
    
    <p>The following code will cause each function to be generated:  </p>
  
  <pre><code>Empty e1;
  Empty e2(e1);
  e2 = e1;
  </code></pre>
  </blockquote>
  
  <p>But after disassembling the executable file which was created by compiling the code above, I realized it not the case: there isn't any function being invoked.</p>
  
  <p>Here is the major assembly code:  </p>
  
  <pre><code>00000000004006cd &lt;main&gt;:
    4006cd:       55                      push   %rbp
    4006ce:       48 89 e5                mov    %rsp,%rbp
    4006d1:       b8 00 00 00 00          mov    $0x0,%eax
    4006d6:       5d                      pop    %rbp
    4006d7:       c3                      retq 
  </code></pre>
  
  <p>There isn't any function named "Empty" in the <code>.text</code> segment.</p>
  
  <p>Then what indeed is the behaviour of a compiler after we call a constructor or assignment of an empty class? Does it generate some functions as the book said? If so, where are they stored?</p>