|
Boost : |
From: Neal Becker (ndbecker2_at_[hidden])
Date: 2006-05-30 11:41:20
#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));
}
wrap/test.cc:12: error: invalid initialization of non-const reference of
type 'boost::iterator_range<__gnu_cxx::__normal_iterator<int*,
std::vector<int, std::allocator<int> > > >&' from a temporary of type
'boost::iterator_range<__gnu_cxx::__normal_iterator<int*, std::vector<int,
std::allocator<int> > > >'
wrap/test.cc:6: error: in passing argument 2 of 'void copy(const in_t&,
out_t&) [with in_t =
boost::iterator_range<__gnu_cxx::__normal_iterator<int*, std::vector<int,
std::allocator<int> > > >, out_t =
boost::iterator_range<__gnu_cxx::__normal_iterator<int*, std::vector<int,
std::allocator<int> > > >]'
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk