Boost C++ Libraries: Ticket #7711: python and unique_ptr https://svn.boost.org/trac10/ticket/7711 <p> boost::python supports holding objects by std::auto_ptr&lt;&gt; but not by std::unique_ptr&lt;&gt;. Would be great if boost::python were updated to support std::unique_ptr&lt;&gt; as well. </p> <p> Here is a sample: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;boost/python.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;memory&gt;</span><span class="cp"></span> <span class="k">struct</span> <span class="n">Foo</span> <span class="p">{};</span> <span class="n">BOOST_PYTHON_MODULE</span><span class="p">(</span><span class="n">foo</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// This compiles fine.</span> <span class="n">boost</span><span class="o">::</span><span class="n">python</span><span class="o">::</span><span class="n">class_</span><span class="o">&lt;</span> <span class="n">Foo</span> <span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">auto_ptr</span><span class="o">&lt;</span><span class="n">Foo</span><span class="o">&gt;</span> <span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">noncopyable</span> <span class="o">&gt;</span><span class="p">(</span><span class="s">&quot;Foo1&quot;</span><span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">python</span><span class="o">::</span><span class="n">no_init</span><span class="p">)</span> <span class="p">;</span> <span class="c1">// This doesn&#39;t compile.</span> <span class="n">boost</span><span class="o">::</span><span class="n">python</span><span class="o">::</span><span class="n">class_</span><span class="o">&lt;</span> <span class="n">Foo</span> <span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">unique_ptr</span><span class="o">&lt;</span><span class="n">Foo</span><span class="o">&gt;</span> <span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">noncopyable</span> <span class="o">&gt;</span><span class="p">(</span><span class="s">&quot;Foo2&quot;</span><span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">python</span><span class="o">::</span><span class="n">no_init</span><span class="p">)</span> <span class="p">;</span> <span class="p">}</span> </pre></div></div> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7711 Trac 1.4.3 Stefan Seefeld Thu, 01 Sep 2016 04:04:20 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7711#comment:1 https://svn.boost.org/trac10/ticket/7711#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">duplicate</span> </li> </ul> <p> Follow up in <a class="ext-link" href="https://github.com/boostorg/python/issues/80"><span class="icon">​</span>https://github.com/boostorg/python/issues/80</a> </p> Ticket