
30 May
2006
30 May
'06
5:48 p.m.
Thorsten Ottosen wrote:
Eric Niebler wrote:
Neal Becker wrote:
#include <boost/range.hpp> #include <vector>
template<typename in_t, typename out_t> void copy (in_t const& in, out_t &out) {}
int main() { std::vector<int> out (2); copy (boost::make_iterator_range (out.begin(), out.begin()+2), boost::make_iterator_range (out.begin(), out.begin()+2)); }
If make_iterator_range() returned a const-qualified iterator_range<>, this would work. Thorsten?
Isn't the problem thet out is a reference?
out is a reference, which means that non-const rvalues will not bind to it. But const rvalues will because out_t will be deduced to be "iterator_range<> const". Try it and see. -- Eric Niebler Boost Consulting www.boost-consulting.com