title: Error while passing std::unique_ptr to class
body: <p>I have to create the instance of class which inherits from abstract class. My code is really simple. It should create the instance of object class based on abstract class. The abstract class is template class aswell. Then I need to put this object into storage class which holds pointer to the object. While passing pointer I am getting errors:</p>
  
  <pre><code>templates.cpp: In member function ‘void storage::setPTR(std::unique_ptr&lt;child&gt;&amp;)’:
  templates.cpp:39:28: error: use of deleted function ‘std::unique_ptr&lt;_Tp, _Dp&gt;&amp; std::unique_ptr&lt;_Tp, _Dp&gt;::operator=(const std::unique_ptr&lt;_Tp, _Dp&gt;&amp;) [with _Tp = child; _Dp = std::default_delete&lt;child&gt;]’
               this-&gt;childPTR = pointer;
                              ^
  In file included from /usr/include/c++/5/memory:81:0,
                   from templates.cpp:3:
  /usr/include/c++/5/bits/unique_ptr.h:357:19: note: declared here
         unique_ptr&amp; operator=(const unique_ptr&amp;) = delete;
                     ^
  templates.cpp: In function ‘int main()’:
  templates.cpp:45:30: error: type/value mismatch at argument 1 in template parameter list for ‘template&lt;class _Tp, class _Dp&gt; class std::unique_ptr’
       std::unique_ptr&lt;INTERFACE&gt; p = std::make_unique&lt;child&gt;("xxx");
                                ^
  templates.cpp:45:30: note:   expected a type, got ‘INTERFACE’
  templates.cpp:45:30: error: template argument 2 is invalid
  templates.cpp:45:65: error: cannot convert ‘std::_MakeUniq&lt;child&gt;::__single_object {aka std::unique_ptr&lt;child&gt;}’ to ‘int’ in initialization
       std::unique_ptr&lt;INTERFACE&gt; p = std::make_unique&lt;child&gt;("xxx");
                                                                   ^
  templates.cpp:48:24: error: ‘newChild’ was not declared in this scope
       testStorage.setPTR(newChild);
                          ^
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;memory&gt;
  
  // using namespace std;
  
  template&lt;typename type1, typename type2, typename type3&gt; class INTERFACE {
      protected:
          type1 x;
          type2 y;
          type3 name;
  
      public:
          virtual type1 setX(type1 x) = 0;
          virtual type2 setY(type2 y) = 0;
  };
  
  class child : public INTERFACE&lt;int, float, std::string&gt; {
      public:
          child(std::string z) {
              this-&gt;name = z;
          }
  
          virtual int setX(int x) override {
              this-&gt;x = x;
          } 
  
          virtual float setY(float y) override {
              this-&gt;y = y;
          }
  };
  
  class storage {
      private:
          std::unique_ptr&lt;child&gt; childPTR;
  
      public:
          void setPTR(std::unique_ptr&lt;child&gt; &amp; pointer) {
              this-&gt;childPTR = pointer;
          }
  };
  
  int main(){
      // std::unique_ptr&lt;INTERFACE&gt; newChild(new child("xxx"));
      std::unique_ptr&lt;INTERFACE&gt; p = std::make_unique&lt;child&gt;("xxx");
  
      storage testStorage;
      testStorage.setPTR(newChild);
  
      return 0;
  }
  </code></pre>
  
  <p>What I am doing wrong?</p>