
On Wed, 7 Sep 2011, Takatoshi Kondo wrote:
Hi, All
I'm using Boost.Graph and Boost.Iterators.
When I use the compressed_sparse_row_graph with reverse_iterator, I ran into a problem.
When I dereference the reverse_iterator of compressed_sparse_row_graph's iterator, invalid memory access occurs.
I tried my copy of GCC 4.6, and get a similar problem. It does not seem to related to Boost.Graph at all, though; I get the same result (use of uninitialized value) with counting_iterators that are created directly (CSR graph vertex_iterators are counting_iterators). I changed the subject line to emphasize the Boost.Iterator issue. Here is a trimmed-down program that has similar problems, even with optimization disabled: #include <boost/iterator/reverse_iterator.hpp> #include <boost/iterator/counting_iterator.hpp> #include <iostream> int main() { boost::counting_iterator<int> ie(2); boost::reverse_iterator<boost::counting_iterator<int> > rib(ie); std::cout << *rib << std::endl; return 0; } -- Jeremiah Willcock