
On Thu, 8 Sep 2011, Takatoshi Kondo wrote:
Hi,
On Thu, 8 Sep 2011 07:48:01 +0900 Michel Morin <mimomorin@gmail.com> wrote:
Relevant ticket (#2640): https://svn.boost.org/trac/boost/ticket/2640 Legal forward iterators cannot store their referents (was: counting_iterator::reference lifetime tied to iterator)
Thanks, I've understood what is the problem. I think that when we write a generic algrithm using reverse_iterator or make own iterator using counting_iterator, we should refer to this problem in comment.
Anyway my problem has solved. Thanks again :)
One further note -- there is nothing in the BGL requirements that states that vertex_iterators need to be bidirectional, so you cannot rely on that being true for arbitrary graph types (see http://www.boost.org/doc/libs/1_47_0/libs/graph/doc/VertexListGraph.html). -- Jeremiah Willcock