Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-01-10 21:44:22


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.)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net