Boost.Bind overload failure

I'm trying to figure out what the problem is with the following code, given: double test_proc(int a, char b, long c) { return a+b+c; } Then: boost::bind<double>(&test_proc, 0, 0, 0); The code compiles fine with VC7.1 but with gcc-3.3.3 I get: ../../../libs/tr1/test/test_3_6.cpp:65: error: call of overloaded `bind(double (*)(int, char, long int), int, int, int)' is ambiguous c:/data/boost/develop/boost/boost/bind/bind_cc.hpp:47: error: candidates are: boost::_bi::bind_t<R, R (*)(B1, B2, B3), typename boost::_bi::list_av_3<A1, A2, A3>::type> boost::bind(R (*)(B1, B2, B3), A1, A2, A3) [with R = double, B1 = int, B2 = char, B3 = long int, A1 = int, A2 = int, A3 = int] c:/data/boost/develop/boost/boost/bind.hpp:1148: error: boost::_bi::bind_t<R, F, typename boost::_bi::list_av_3<A1, A2, A3>::type> boost::bind(F, A1, A2, A3) [with R = double, F = double (*)(int, char, long int), A1 = int, A2 = int, A3 = int] And with Intel 8.1 I get: ..\..\..\libs\tr1\test\.\test_3_6.cpp(65): error: more than one instance of over loaded function "boost::bind" matches the argument list: function template "boost::bind(R (*)(B1, B2, B3), A1, A2, A3)" function template "boost::bind<R,F,A1,A2,A3>(F, A1, A2, A3)" argument types are: (double (*)(int, char, long), int, int, int) check_bind0(boost::bind<double>(&test_proc, 0, 0, 0), double(0)); ^ Who's correct here? Normally I would trust EDG/Intel to get this correct if anyone would. Thanks, John.

John Maddock wrote:
I'm trying to figure out what the problem is with the following code, given: double test_proc(int a, char b, long c) { return a+b+c; }
Then:
boost::bind<double>(&test_proc, 0, 0, 0);
The code compiles fine with VC7.1 but with gcc-3.3.3 I get:
[ambiguity]
And with Intel 8.1 I get:
[ambiguity]
Who's correct here? Normally I would trust EDG/Intel to get this correct if anyone would.
Does it matter? The correct call is bind( test_proc, 0, 0, 0 ). It's an interesting core language question how partial ordering should work in situations when a template parameter is explicitly supplied. I don't expect any further changes to that part of the standard, however. :-)
participants (2)
-
John Maddock
-
Peter Dimov