Subject: [Boost-bugs] [Boost C++ Libraries] #4223: boost::python exception translator causes ambiguous call errors with Visual Studio 2010
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-05-17 04:05:01
#4223: boost::python exception translator causes ambiguous call errors with Visual
Studio 2010
-------------------------------+--------------------------------------------
Reporter: blaquee@⦠| Owner:
Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: None
Version: Boost 1.44.0 | Severity: Problem
Keywords: |
-------------------------------+--------------------------------------------
There is an occasion where the use of the register_exception_translator
template function causes:
error C2668: 'boost::bind' : ambiguous call to overloaded function
the particular file and line are located here:
https://svn.boost.org/trac/boost/browser/trunk/boost/python/exception_translator.hpp
Line 21, where the call to bind is not properly scoped to a namespace and
causes the compiler to resolve incorrectly. The error looks like this:
{{{
D:\boost_1_42\boost/python/exception_translator.hpp(21): error C2668:
'boost::bind' : ambiguous call to overloaded function
1> D:\boost_1_42\boost/bind/bind.hpp(1322): could be
'boost::_bi::bind_t<R,F,L>
boost::bind<bool,boost::python::detail::translate_exception<ExceptionType,Translate>,boost::arg<I>,boost::arg<2>,Translate>(F,A1,A2,A3)'
1> with
1> [
1> R=bool,
1>
F=boost::python::detail::translate_exception<WSException,init_module_wshook::WSExceptionTranslator>,
1>
L=boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<init_module_wshook::WSExceptionTranslator>>,
1> ExceptionType=WSException,
1> Translate=init_module_wshook::WSExceptionTranslator,
1> I=1,
1> A1=boost::arg<1>,
1> A2=boost::arg<2>,
1> A3=init_module_wshook::WSExceptionTranslator
1> ]
1> C:\Program Files\Microsoft Visual Studio
10.0\VC\include\xxbind1(323): or
'std::tr1::_Bind<_Result_type,_Ret,_BindN>
std::tr1::bind<bool,boost::python::detail::translate_exception<ExceptionType,Translate>,boost::arg<I>,boost::arg<2>,Translate>(_Fty,_Arg0,_Arg1,_Arg2)'
[found using argument-dependent lookup]
1> with
1> [
1> _Result_type=bool,
1> _Ret=bool,
1>
_BindN=std::tr1::_Bind3<std::tr1::_Callable_obj<boost::python::detail::translate_exception<WSException,init_module_wshook::WSExceptionTranslator>,false>,boost::arg<1>,boost::arg<2>,init_module_wshook::WSExceptionTranslator>,
1> ExceptionType=WSException,
1> Translate=init_module_wshook::WSExceptionTranslator,
1> I=1,
1>
_Fty=boost::python::detail::translate_exception<WSException,init_module_wshook::WSExceptionTranslator>,
1> _Arg0=boost::arg<1>,
1> _Arg1=boost::arg<2>,
1> _Arg2=init_module_wshook::WSExceptionTranslator
1> ]
1> while trying to match the argument list
'(boost::python::detail::translate_exception<ExceptionType,Translate>,
boost::arg<I>, boost::arg<I>, init_module_wshook::WSExceptionTranslator)'
1> with
1> [
1> ExceptionType=WSException,
1> Translate=init_module_wshook::WSExceptionTranslator
1> ]
1> and
1> [
1> I=1
1> ]
1> and
1> [
1> I=2
1> ]
1> wspluginmanager_python.cpp(179) : see reference to function
template instantiation 'void
boost::python::register_exception_translator<WSException,init_module_wshook::WSExceptionTranslator>(Translate,boost::type<T>
*)' being compiled
1> with
1> [
1> Translate=init_module_wshook::WSExceptionTranslator,
1> T=WSException
1> ]
1>
}}}
The line of code that would cause such an error is:
{{{
py::register_exception_translator<WSException>(WSExceptionTranslator());
}}}
namespace py = boost::python
The fix for this would be to properly use boost::bind at line 21 and cause
it to resolve properly on Visual Studio 2010 RTM.
Thank you.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4223> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC