Boost C++ Libraries: Ticket #3054: boost::python doesn't support implicit intrusive_ptr casts https://svn.boost.org/trac10/ticket/3054 <p> See <a class="ext-link" href="http://mail.python.org/pipermail/cplusplus-sig/2007-February/011651.html"><span class="icon">​</span>http://mail.python.org/pipermail/cplusplus-sig/2007-February/011651.html</a> for code that solves this. (the boostPatch namespace contents) </p> <p> I couldn't find anything on Boost.Python in the release notes for 1.38 or 1.39, so I assume it's still in there. </p> <p> Also, for those who need this before it's included in boost::python::class_, a better use of the functions (than the typedeffing in the post above) is: </p> <div class="wiki-code"><div class="code"><pre><span class="k">template</span><span class="o">&lt;</span><span class="k">class</span> <span class="nc">T</span><span class="p">,</span> <span class="k">class</span> <span class="nc">B</span><span class="p">,</span> <span class="k">class</span> <span class="nc">X</span><span class="p">,</span> <span class="k">class</span> <span class="nc">Y</span><span class="o">&gt;</span> <span class="k">class</span> <span class="nc">myclass</span> <span class="o">:</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">T</span><span class="p">,</span> <span class="n">B</span><span class="p">,</span> <span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="o">&gt;</span> <span class="p">{</span> <span class="k">public</span><span class="o">:</span> <span class="k">template</span><span class="o">&lt;</span><span class="k">class</span> <span class="nc">Constructor</span><span class="o">&gt;</span> <span class="n">myclass</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">name</span><span class="p">,</span> <span class="k">const</span> <span class="n">Constructor</span><span class="o">&amp;</span> <span class="n">t</span><span class="p">)</span> <span class="o">:</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">T</span><span class="p">,</span> <span class="n">B</span><span class="p">,</span> <span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="o">&gt;</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">t</span><span class="p">)</span> <span class="p">{</span> <span class="n">boostPatch</span><span class="o">::</span><span class="n">register_intrusive_ptr_from_python_and_casts</span><span class="p">(</span> <span class="p">(</span><span class="n">T</span> <span class="o">*</span><span class="p">)</span><span class="mi">0</span><span class="p">,</span> <span class="n">metadata</span><span class="o">::</span><span class="n">bases</span><span class="p">()</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/3054 Trac 1.4.3 troy d. straszheim Tue, 13 Oct 2009 01:05:51 GMT owner changed https://svn.boost.org/trac10/ticket/3054#comment:1 https://svn.boost.org/trac10/ticket/3054#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Dave Abrahams</span> to <span class="trac-author">troy d. straszheim</span> </li> </ul> Ticket kernys01@… Sat, 02 Feb 2013 07:52:28 GMT <link>https://svn.boost.org/trac10/ticket/3054#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3054#comment:2</guid> <description> <p> any progress here? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 06 Feb 2013 08:18:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3054#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3054#comment:3</guid> <description> <p> We haven't upgraded our Boost version since I wrote that, so I can't comment on that </p> <p> This ticket hasn't gotten any love, that's for sure... :( </p> </description> <category>Ticket</category> </item> </channel> </rss>