Boost logo

Boost :

From: Neal Becker (ndbecker2_at_[hidden])
Date: 2005-10-21 06:58:42


I'm using bind with boost-1.33. I can't get a simple test to work:

-----------
#include <boost/bind.hpp>

int G (int a, int b, int c) { return a + b + c; }

int main () {
  int x = boost::bind (G,_1, 4, 8)(2);
}
-----------

g++ -fsyntax-only -I../ -I../../src TestScale.cc
TestScale.cc: In function ‘int main()’:
TestScale.cc:14: error: no match for call to ‘(boost::_bi::bind_t<int, int
(*)(int, int, int), boost::_bi::list3<boost::arg<1>,
boost::_bi::value<int>, boost::_bi::value<int> > >) (int)’
/usr/include/boost/bind/bind_template.hpp:17: note: candidates are: typename
boost::_bi::result_traits<R, F>::type boost::_bi::bind_t<R, F,
L>::operator()() [with R = int, F = int (*)(int, int, int), L =
boost::_bi::list3<boost::arg<1>, boost::_bi::value<int>,
boost::_bi::value<int> >]
/usr/include/boost/bind/bind_template.hpp:23: note: typename
boost::_bi::result_traits<R, F>::type boost::_bi::bind_t<R, F,
L>::operator()() const [with R = int, F = int (*)(int, int, int), L =
boost::_bi::list3<boost::arg<1>, boost::_bi::value<int>,
boost::_bi::value<int> >]
/usr/include/boost/bind/bind_template.hpp:29: note: typename
boost::_bi::result_traits<R, F>::type boost::_bi::bind_t<R, F,
L>::operator()(A1&) [with A1 = int, R = int, F = int (*)(int, int, int), L
= boost::_bi::list3<boost::arg<1>, boost::_bi::value<int>,
boost::_bi::value<int> >]
/usr/include/boost/bind/bind_template.hpp:35: note: typename
boost::_bi::result_traits<R, F>::type boost::_bi::bind_t<R, F,
L>::operator()(A1&) const [with A1 = int, R = int, F = int (*)(int, int,
int), L = boost::_bi::list3<boost::arg<1>, boost::_bi::value<int>,
boost::_bi::value<int> >]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk