Opened 7 years ago
#11481 new Bugs
zip_iterator issue with _GLIBCXX_DEBUG and std::vector::insert
| Reported by: | Owned by: | jeffrey.hellrung | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | iterator |
| Version: | Boost 1.57.0 | Severity: | Problem |
| Keywords: | Cc: |
Description
If one uses the zip_iterator class template with std::vector::insert(It1, It2, It2), with _GLIBCXX_DEBUG defined, g++ return a compilation error:
/usr/include/c++/4.9.2/debug/functions.h:220:69: error: invalid initialization of non-const reference of type ‘boost::tuples::cons<int&, boost::tuples::cons<int&, boost::tuples::null_type> >&’ from an rvalue of type ‘boost::iterator_facade<boost::zip_iterator<boost::tuples::tuple<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*, std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int> >, __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*, std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int> > > >, boost::tuples::cons<int&, boost::tuples::cons<int&, boost::tuples::null_type> >, boost::random_access_traversal_tag, boost::tuples::cons<int&, boost::tuples::cons<int&, boost::tuples::null_type> >, long int>::reference {aka boost::tuples::cons<int&, boost::tuples::cons<int&, boost::tuples::null_type> >}’
return __foreign_iterator_aux4(__it, std::__addressof(*__other));
^
The attached test case test.cpp shows the error, with g++-4.9.
Attachments (1)
Note:
See TracTickets
for help on using tickets.
