title: How do I create a container that will work properly with std::unique_ptr as a template parameter?
body: <p>Suppose I have a Mutexed queue called MQueue:</p>
  
  <pre><code>#include &lt;deque&gt;
  
  template&lt; typename T &gt;
  class MQueue
  {
    public:
      T* pop()
      {
        lock();
        T* ptr = nullptr;
        // get it out of m_dq...
        unlock();
        return ptr;
      }
      // push, etc... and other methods
    private:
      std::deque&lt;T*&gt; m_dq;
  };
  </code></pre>
  
  <p>The following instantiation has been tested and works fine:</p>
  
  <p><code>MQueue&lt; int &gt; my_simple_mq;</code></p>
  
  <p>What kinds of modifications do I need to make to MQueue to ensure that</p>
  
  <pre><code>MQueue&lt; std::unique_ptr&lt; int &gt; &gt; my_smart_mq;
  </code></pre>
  
  <p>will behave properly?  I have attempted to browse the code to std::vector&lt;> for reference, but it's difficult for me to discern which parts of the implementation are pertinent for the proper working of smart pointers.  Any references or links would be greatly appreciated.</p>