I was using boost::bind with boost::tuple as shown in the code snippet below.
This piece of code compiles and executes fine in Visual Studio 2005
but while compiling with gcc-4.1 It throws error "unresolved
overloaded function type"
(This code actually does nothing except reproduce the error)
I guess its because gcc was unable to figure out which get() to call
as there are two
version const and non const.
Any suggestion how to make it work with gcc as well as VS2005.
Code
----------------
#include
#include
int main(int argc, char * argv[])
{
typedef boost::tuple myTuple;
myTuple mt;
boost::bind(&myTuple::get<0>, _1)(mt);
return 0;
}
gcc error..
--------------------
Test.cpp: In function 'int main(int, char**)':
Test.cpp:13: error: call of overloaded 'bind(<unresolved overloaded
function type>, boost::arg<1> (&)())' is ambiguous
../../../../../Boost/boost/bind/bind_mf_cc.hpp:20: note: candidates
are: boost::_bi::bind_t, typename
boost::_bi::list_av_1<A1>::type> boost::bind(R (T::*)(), A1) [with R =
int&, T = boost::tuples::cons > >, A1 =
boost::arg<1> (*)()]
../../../../../Boost/boost/bind/bind_mf_cc.hpp:30: note:
boost::_bi::bind_t, typename
boost::_bi::list_av_1<A1>::type> boost::bind(R (T::*)()const, A1)
[with R = const int&, T = boost::tuples::cons > >, A1 = boost::arg<1> (*)()]
Thanks
Moyukh