
11 Jan
2006
11 Jan
'06
2:44 a.m.
David Greene wrote:
Is it possible to bind template functions? If so, what's the syntax? I'm having trouble with this test:
#include <boost/lambda/bind.hpp> #include <boost/numeric/interval.hpp>
#include <vector> #include <cassert>
typedef boost::numeric::interval<int> range;
[...]
// bind(&boost::numeric::in<range>, 5, _1));
Try bind( boost::numeric::in<range::base_type, range::traits_type>, 5, _1 ) in<> has two template parameters, T and Policies; the & needs to be absent because Lambda has overloads for function references but not for function pointers (the variation with & works with boost::bind, though.)