|
Boost : |
From: John Maddock (john_at_[hidden])
Date: 2005-02-11 07:48:59
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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk