title: Can boost::lockfree::stack accept string pointers safely?
body: <p>I've discovered that passing a <code>string</code> pointer into a <code>boost::lockfree::queue</code> will cause a memory leak because the <code>string</code> pointer cannot be fully released.</p>
  
  <p>Is the situation the same for a <a href="http://www.boost.org/doc/libs/1_55_0/doc/html/boost/lockfree/stack.html" rel="nofollow"><code>boost::lockfree::stack</code></a>?</p>
  
  <p>The requirement for a <code>boost::lockfree::stack</code> is:</p>
  
  <blockquote>
    <ul>
    <li>T must have a copy constructor</li>
    </ul>
  </blockquote>
  
  <p>If a regular <code>string</code> pointer cannot be used, is there any other way a <code>string</code> can be put into a <code>boost::lockfree::stack</code>?</p>
  
  <h2>Regular <code>string</code></h2>
  
  <p>When I try this</p>
  
  <pre><code>boost::lockfree::stack&lt;string&gt; my_stack(128);
  </code></pre>
  
  <p>I get these errors</p>
  
  <pre><code> BOOST_STATIC_ASSERT(boost::has_trivial_assign&lt;T&gt;::value);
   BOOST_STATIC_ASSERT(boost::has_trivial_destructor&lt;T&gt;::value);
  </code></pre>
  
  <p>which seems strange to me, probably because of my inexperience, because those are actually the requirements for <a href="http://www.boost.org/doc/libs/1_54_0/doc/html/boost/lockfree/queue.html" rel="nofollow"><code>boost::lockfree::queue</code></a> which now strangely has no documentation</p>
  
  <blockquote>
    <ul>
    <li>T must have a copy constructor</li>
    <li>T must have a trivial assignment operator</li>
    <li>T must have a trivial destructor</li>
    </ul>
  </blockquote>