FWIW Finally had a chance to get back to this and found a way to make it work.<br>
<br>
If I remove the implicit conversion from smart_ptr&lt;Factory&gt; to
smart_ptr&lt;Factory_wrapper&gt; in the base class export all is good. <br>
<br>
Not sure why that leads to the loop and seg fault if you derive from BasicFactory in python though. <br>
<br><br><div><span class="gmail_quote">On 8/19/05, <b class="gmail_sendername">Scott McKay</b> &lt;<a href="mailto:skottmckay@gmail.com">skottmckay@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>That has led me to a question on what is required in terms of implicit<br>conversion calls to handle classes in the same hierarchy that are<br>wrapped with wrapper&lt;&gt; and held by smart pointers. I can't seem to<br>
find a combination to allow derivation from both Factory and<br>BasicFactory.<br><br>void Export_Factory()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;class_&lt; Factory_Wrapper, smart_ptr&lt; Factory_Wrapper &gt; &gt;(&quot;Factory&quot;,<br>init&lt;&nbsp;&nbsp;&gt;())
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.def(&quot;generate&quot;, &amp;Factory::generate,<br>&amp;Factory_Wrapper::default_generate, return_self&lt;&gt;())<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.def(init&lt; const Factory&amp; &gt;())<br>&nbsp;&nbsp;&nbsp;&nbsp;;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;implicitly_convertible&lt; smart_ptr&lt; Factory_Wrapper &gt;, smart_ptr&lt;
<br>Factory &gt; &gt;();<br>&nbsp;&nbsp;&nbsp;&nbsp;implicitly_convertible&lt; smart_ptr&lt; Factory &gt;, smart_ptr&lt;<br>Factory_Wrapper &gt; &gt;();<br>}<br><br><br><br>void Export_BasicFactory()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;class_&lt; BasicFactory_Wrapper, bases&lt; Factory &gt; , smart_ptr&lt;
<br>BasicFactory_Wrapper &gt; &gt;(&quot;BasicFactory&quot;, init&lt;&nbsp;&nbsp;&gt;())<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.def(&quot;generate&quot;, (Factory&amp; (BasicFactory::*)(SourceGroup&amp;)<br>)&amp;BasicFactory::generate, (Factory&amp;<br>(BasicFactory_Wrapper::*)(SourceGroup&amp;))&amp;BasicFactory_Wrapper::default_generate,
<br>return_self&lt;&gt;())<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.def(init&lt; const BasicFactory&amp; &gt;())<br>&nbsp;&nbsp;&nbsp;&nbsp;;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;implicitly_convertible&lt; smart_ptr&lt; BasicFactory_Wrapper &gt;,<br>smart_ptr&lt; Factory &gt; &gt;();<br>&nbsp;&nbsp;&nbsp;&nbsp;implicitly_convertible&lt; smart_ptr&lt; Factory &gt;, smart_ptr&lt;
<br>BasicFactory_Wrapper &gt; &gt;();<br>}<br><br>
</blockquote></div><br>