
6 Oct
2009
6 Oct
'09
6:10 p.m.
Neal Becker wrote:
But, these don't compile: sum (boost::make_iterator_range<double const*> (x, x+size)); sum (boost::make_iterator_range<double *> (x, x+size));
That's because there are different overloads of make_iterator_range. You're not supposed to specify any template parameter, since the point of all make_* functions is to deduce these automatically. If you want to specify them, then use the constructor of iterator_range directly.
I'm stumped.
The reason I need this, is I will need the type of range returned by boost::make_iterator_range (double*, double*). Apparantly, it's not boost::iterator_range<double*>.
make_iterator_range(double*, double*) does return an iterator_range<double*>.