This is a question about using implicitly_convertible to convert vector to another custom class type. <br><br>I already have boost python type conversion code to convert Python list/tuple to c++ vector, which works fine. There is another custom class EMObject, which is a thin wrapper to many builit-in type. It takes a built-in type like int, float, string, and vector as a single constructor argument and return type. So those built-in type can convert to and from EMObject implicitly. The functions in c++ which takes this EMObject as an argument are expose to Python. Now I need call these functions in Python with argument from Python list or tuple. Since I already convert python list/tuple to c++ vector, I just need declare implicit type conversion from vector to EMObject like following:<br>
<br>implicitly_convertible&lt;vector&lt;float&gt;, EMAN::EMObject&gt;();<br>implicitly_convertible&lt;vector&lt;int&gt;, EMAN::EMObject&gt;();<br>implicitly_convertible&lt;vector&lt;std::string&gt;, EMAN::EMObject&gt;();<br>
<br clear="all">This seems a perfect solution to my question. But unfortunately I find out only the first one working, regardless which one is the first. Could anybody tell me why this happen?<br><br>-- <br>Grant<br>