title: How to clone an object without copy constructor
body: <p>According to CppCoreGuideline, I should disable the copy constructor of a base class and propose a clone method: <a href="https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rc-copy-virtual" rel="nofollow noreferrer">https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rc-copy-virtual</a></p>
  
  <p>For example:</p>
  
  <pre><code>class B {
     public:
       explicit B() = default;
       B(B&amp;&amp;) = default; // Move constructor
       B&amp; operator=(B&amp;&amp;) = default; // Move assignment operator
       B(const B&amp;) = delete; // Copy constructor
       B&amp; operator=(const B&amp;) = delete; // Copy assignment
       virtual ~B() = default;
  
       virtual unique_ptr&lt;B&gt; clone()
       {
          return unique_ptr&lt;B&gt;{new B{*this}}; // how do this without copy constructor ?
       }
      private:
       int c;
       int d;
  };
  
  class D : public B {
      public:
       explicit D() = default;
       D(D&amp;&amp;) = default; // Move constructor
       D&amp; operator=(D&amp;&amp;) = default; // Move assignment operator
       D(const B&amp;) = delete; // Copy constructor
       D&amp; operator=(const D&amp;) = delete; // Copy assignment
       virtual ~D() = default;
  
       virtual unique_ptr&lt;B&gt; clone() override
       {
            //  how can I copy all private data member of base class ???
       }
  };
  </code></pre>
  
  <p>but how can I copy all private data member in clone method? Obviously I'll use the CRTP pattern : <a href="https://stackoverflow.com/questions/12255546/c-deep-copying-a-base-class-pointer">C++: Deep copying a Base class pointer</a> </p>