While I've successfully used boost::bind before, I cannot seem to get this
simple test case to work.
#include boost/bind.hpp
#include iostream
using namespace boost;
using namespace std;
struct X
{
void f( int i )
{
cout i \n;
}
};
int main( int argc, char * argv[] )
{
X x;
bind( X::f, x, 6 )(); // works
bind( X::f, x, _1 )( 6 ); // error!
return 0;
}
It fails during compilation with the following error messages:
callback.cpp: In function `int main (int, char **)':
callback.cpp:20: no match for call to `(boost::_bi::bind_tvoid,
boost::_mfi::mf1void, X, int, boost::_bi::list2boost::_bi::valueX
*, boost::arg1 ) (int)'
/usr/local/include/boost/bind/bind_template.hpp:19: candidates are: typename
boost::_bi::result_traitsR, F::type boost::_bi::bind_tR, F,
L::operator() () [with R = void, F =
boost::_mfi::mf1void, X, int, L = boost::_bi::list2boost::_bi::valueX
*, boost::arg1 ]
/usr/local/include/boost/bind/bind_template.hpp:25: typename
boost::_bi::result_traitsR, F::type boost::_bi::bind_tR, F,
L::operator() () const [with R = void,
F = boost::_mfi::mf1void, X, int, L =
boost::_bi::list2boost::_bi::valueX *, boost::arg1 ]
/usr/local/include/boost/bind/bind_template.hpp:31: typename
boost::_bi::result_traitsR, F::type boost::_bi::bind_tR, F,
L::operator() (A1 ) [with A1 = int, R
= void, F = boost::_mfi::mf1void, X, int, L =
boost::_bi::list2boost::_bi::valueX *, boost::arg1
]
/usr/local/include/boost/bind/bind_template.hpp:37: typename
boost::_bi::result_traitsR, F::type boost::_bi::bind_tR, F,
L::operator() (A1 ) const [with A1 =
int, R = void, F = boost::_mfi::mf1void, X, int, L =
boost::_bi::list2boost::_bi::valueX *,
boost::arg1 ]
Suggestions?
Marc
___
Unsubscribe other changes: http://lists.boost.org/mailman/listinfo.cgi/boost