Boost C++ Libraries: Ticket #11337: implicit_cast in python/include/boost/python/opaque_pointer_converter.hpp should be boost:: qualified https://svn.boost.org/trac10/ticket/11337 <p> The following test case fails to compile: </p> <pre class="wiki">template &lt;typename T&gt; inline T implicit_cast (void *) { // In reality there is an actual ::implicit_cast implementation in a header file return 0; } #include &lt;boost/python.hpp&gt; int main() { return 0; } </pre><p> The error is: </p> <pre class="wiki">In file included from ./python/include/boost/python.hpp:49:0, from /tmp/implicit_cast.cc:6: ./python/include/boost/python/opaque_pointer_converter.hpp: In static member function ‘static void* boost::python::opaque&lt;Pointee&gt;::extract(PyObject*)’: ./python/include/boost/python/opaque_pointer_converter.hpp:66:68: error: call of overloaded ‘implicit_cast(PyObject*&amp;)’ is ambiguous ? static_cast&lt;python_instance*&gt;(implicit_cast&lt;void*&gt;(op))-&gt;x ^ ./python/include/boost/python/opaque_pointer_converter.hpp:66:68: note: candidates are: In file included from ./python/include/boost/python/converter/builtin_converters.hpp:11:0, from ./python/include/boost/python/converter/arg_to_python.hpp:17, from ./python/include/boost/python/call.hpp:15, from ./python/include/boost/python/object_core.hpp:14, from ./python/include/boost/python/args.hpp:25, from ./python/include/boost/python.hpp:11, from /tmp/implicit_cast.cc:6: ./conversion/include/boost/implicit_cast.hpp:25:10: note: T boost::implicit_cast(typename boost::detail::icast_identity&lt;T&gt;::type) [with T = void*; typename boost::detail::icast_identity&lt;T&gt;::type = void*] inline T implicit_cast (typename boost::detail::icast_identity&lt;T&gt;::type x) { ^ /tmp/implicit_cast.cc:2:10: note: T implicit_cast(void*) [with T = void*] inline T implicit_cast (void *) { ^ </pre><p> Proposed fix: </p> <pre class="wiki">diff --git a/include/boost/python/opaque_pointer_converter.hpp b/include/boost/python/opaque_pointer_converter.hpp index 10eb423..70ab1fe 100644 --- a/include/boost/python/opaque_pointer_converter.hpp +++ b/include/boost/python/opaque_pointer_converter.hpp @@ -63,7 +63,7 @@ private: static void* extract(PyObject* op) { return PyObject_TypeCheck(op, &amp;type_object) - ? static_cast&lt;python_instance*&gt;(implicit_cast&lt;void*&gt;(op))-&gt;x + ? static_cast&lt;python_instance*&gt;(boost::implicit_cast&lt;void*&gt;(op))-&gt;x : 0 ; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11337 Trac 1.4.3 Paul Pluzhnikov <ppluzhnikov@…> Sat, 23 May 2015 22:47:48 GMT version changed https://svn.boost.org/trac10/ticket/11337#comment:1 https://svn.boost.org/trac10/ticket/11337#comment:1 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.57.0</span> → <span class="trac-field-new">Boost Development Trunk</span> </li> </ul> <p> Google ref: b/21321370 </p> Ticket