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_t<void, boost::_mfi::mf1<void, X, int>, boost::_bi::list2<boost::_bi::value<X *>, boost::arg<1> > >) (int)' /usr/local/include/boost/bind/bind_template.hpp:19: candidates are: typename boost::_bi::result_traits<R, F>::type boost::_bi::bind_t<R, F, L>::operator() () [with R = void, F = boost::_mfi::mf1<void, X, int>, L = boost::_bi::list2<boost::_bi::value<X *>, boost::arg<1> >] /usr/local/include/boost/bind/bind_template.hpp:25: typename boost::_bi::result_traits<R, F>::type boost::_bi::bind_t<R, F, L>::operator() () const [with R = void, F = boost::_mfi::mf1<void, X, int>, L = boost::_bi::list2<boost::_bi::value<X *>, boost::arg<1> >] /usr/local/include/boost/bind/bind_template.hpp:31: typename boost::_bi::result_traits<R, F>::type boost::_bi::bind_t<R, F, L>::operator() (A1 &) [with A1 = int, R = void, F = boost::_mfi::mf1<void, X, int>, L = boost::_bi::list2<boost::_bi::value<X *>, boost::arg<1> >] /usr/local/include/boost/bind/bind_template.hpp:37: typename boost::_bi::result_traits<R, F>::type boost::_bi::bind_t<R, F, L>::operator() (A1 &) const [with A1 = int, R = void, F = boost::_mfi::mf1<void, X, int>, L = boost::_bi::list2<boost::_bi::value<X *>, boost::arg<1> >] Suggestions? Marc _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost