I have to interface with a custom string class. In my handwritten code, I had the example from <a href="http://www.boost.org/doc/libs/1_42_0/libs/python/doc/v2/faq.html#custom_string" target="_blank">http://www.boost.org/doc/libs/1_42_0/libs/python/doc/v2/faq.html#custom_string</a> working.<br>


<br>I&#39;m working with an custom string class. Actually they have a String_mgr class which derives from a String_val, and exposes the string as  a property called &#39;val&#39;. And py++ wraps the String_mgr as an opaque structure with a working &#39;val&#39; property. But the String_mgr class in c++ supports assignment and casting, and that part doesn&#39;t work even though I have done an mb.class_(&#39;String_mgr&#39;).add_properties(exclude_accessors=False). <br>
<br>In my application code I have numerous instances of this String_mgr. I&#39;d like to be able to contain my interactions with the particulars of String_mgr to the one definition and not have to do an .add_property(&#39;foo&#39;, getter, setter) for each and every occurence of their String_mgr class (which are quite numerous).  Can I make assignment and casting work in this way, or must I modify each and every String_mgr occurence as a property? <br>
<br>Just in case it&#39;s not clear, I have<br>struct ClassOne {<br>   String_mgr name;<br>}<br><br>struct ClassTwo {<br>   String_mgr description;<br>}<br><br>and I want to confine all my handling specific to the String_mgr class to one location and let the wrapping of String_mgr handle the property get/set (ClassOne, etc... are IDL generated and numerous.) I can&#39;t seem to both wrap the String_mgr class and have custom converters - I&#39;m told I have a duplicate registration.  Can I get both automatic conversion and the ability to treat this wrapped class as a property of other classes? It seems to trigger on the assignment &amp; casting but I&#39;m just not getting it right now. <br>
<br><br><br>