title: std::list< std::unique_ptr<T> >: passing it around
body: <p>Say I have a <code>std::list</code> of <code>class T</code>'s:</p>
  
  <pre><code>std::list&lt;T&gt; l;
  </code></pre>
  
  <p>When passing it into functions, I would use a reference:</p>
  
  <pre><code>someFunction( std::list&lt;T&gt; &amp;l )
  </code></pre>
  
  <p>What is the best way to pass around (the elements) of a <code>std::list</code> of <code>unique_ptr</code>s?</p>
  
  <pre><code>std::list&lt; std::unique_ptr&lt;T&gt; &gt;  l;
  </code></pre>
  
  <p>Like this:</p>
  
  <pre><code>someFunction( std::unique_ptr&lt;T&gt; ptr )
  </code></pre>
  
  <p>Or this:</p>
  
  <pre><code>someFunction( T* ptr )
  </code></pre>
  
  <p>Or this:</p>
  
  <pre><code>someFunction( T &amp;ref )
  </code></pre>
  
  <p>And what how would I call it using the <code>std::list</code>'s <code>back()</code> function for example? These are IMHO all "kind of" equivalent, but I'm sure I'm missing something here.</p>
  
  <p>Thanks</p>