title: What is causing the move constructor to be deleted
body: <p>I have the following sample:</p>
  
  <pre><code>#include &lt;vector&gt;
  
  class noncopyable {
  protected:
      noncopyable() {}
      ~noncopyable() {}
      noncopyable(const noncopyable&amp;) = delete;
      noncopyable&amp; operator=(const noncopyable&amp;) = delete;
      noncopyable(noncopyable&amp;&amp;) = default;
      noncopyable&amp; operator=(noncopyable&amp;&amp;) = default;
  };
  
  class C1 : private noncopyable {
  public:
    C1() { }
    ~C1() { }
  };
  
  int main() {
      std::vector&lt;C1&gt; v;
      v.emplace_back();
      return 0;
  }
  </code></pre>
  
  <p>I thought it should work since <code>C1</code> should be movable since it's base class is and it has no data members. Instead, I got an an error (using clang++):</p>
  
  <pre><code>error: call to implicitly-deleted copy constructor of 'C1'
      { ::new(static_cast&lt;void*&gt;(__p)) _T1(std::forward&lt;_Args&gt;(__args)...); }
                                       ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  .
  .
  .
  note: in instantiation of function template specialization 'std::vector&lt;C1, std::allocator&lt;C1&gt; &gt;::emplace_back&lt;&gt;' requested here
          v.emplace_back();
            ^
  note: copy constructor of 'C1' is implicitly deleted because base class 'noncopyable' has a deleted copy constructor
  class C1 : private noncopyable {
             ^
  note: 'noncopyable' has been explicitly marked deleted here
          noncopyable(const noncopyable&amp;) = delete;
  </code></pre>
  
  <p>Doing a little research (<a href="http://en.cppreference.com/w/cpp/language/move_constructor" rel="nofollow noreferrer">http://en.cppreference.com/w/cpp/language/move_constructor</a>) revealed that if there is a user-defined destructor then no implicit move-constructor will be defined. This seemes to be the problem here, since <code>C1</code> has a destructor, the move-constructor does not get defined. Sure enough, if I either remove the destructor or add <code>C1(C1&amp;&amp;) = default;</code> to <code>C1</code> then it works.</p>
  
  <p>So far so good.</p>
  
  <p>The problem was that the error message didn't mention <code>~C1()</code> or the move-constructor. It said it was trying to call the copy constructor, which was deleted in the base class. So I tried changing the <code>delete</code>ed functions in <code>noncopyable</code> to be <code>default</code>ed instead, and (surprise!), that also solved the error.</p>
  
  <p>So my question is, what does this last thing have to do with the error or it's correction? If there is a destructor, what is the difference if the base class has the copy-constructor or not?</p>