title: Using a vector of unique pointers to an <Employee> vector
body: <p>For a school assignment, I am trying to use a vector of unique pointer's to Employee objects to access the Employee data, but can't figure out the syntax/compiler errors. Can anybody please tell me what I am doing wrong? Have to use a vector of smart pointers in this fashion.</p>
  
  <p>Here is the applicable code:</p>
  
  <pre><code>// Create an Employee
  Employee EmpRec;
  
  // Assign value to a uniqueptr
  unique_ptr&lt;Employee&gt; TempEmp;
  *TempEmp = EmpRec;
  
  // Create a vector of unique_ptr&lt;Employee&gt;
  vector&lt;unique_ptr&lt;Employee&gt;&gt; EmpVect;
  
  // Push the TempEmp pointer onto the vector
  EmpVect.push_back(TempEmp);
  
  // Iterate through vector, calling display function 
  //that prints the values of various data inside the Employee object
  for (size_t i = 0; i &lt; EmpVect.size(); ++i){
      (EmpVect[i])-&gt;display(cout);
  }
  </code></pre>
  
  <p>This is how my Display function is defined:</p>
  
  <pre><code>void display(std::ostream&amp; cout) const{
      // print data members using cout &lt;&lt;
  }
  </code></pre>
  
  <p>When trying to compile this, I get the following error:</p>
  
  <p>d:\microsoft visual studio 12.0\vc\include\xmemory0(593): error C2280: 'std::unique_ptr>::unique_ptr(const std::unique_ptr&lt;_Ty,std::default_delete&lt;_Ty>> &amp;)' : attempting to reference a deleted function</p>