Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] inv_adjacency_iterator is missing in graph_traits.hpp
From: Johan Oudinet (johan.oudinet_at_[hidden])
Date: 2012-07-23 12:22:30


Hi again,

On Mon, Jul 23, 2012 at 6:15 PM, Johan Oudinet <johan.oudinet_at_[hidden]> wrote:
> Hi,
>
> I have a bidirectional adjacency list and I want to use the
> inv_adjacent_vertices method
> However, the following code does not compile:
> typedef boost::graph_traits<Graph> Traits;
> typedef typename Traits::inv_adjacency_iterator inv_adjacency_iterator;
> inv_adjacency_iterator w, w_end;
> boost::tie (w, w_end) = inv_adjacent_vertices (v, g_);
>
> The problem is that inv_adjacency_iterator is not part of
> boost::graph_traits :-(
>
> Could you tell me how can I use the inv_adjacent_vertices method
> (i.e., how can I declare an inv_adjacent_iterator)?

Obviously, I found a workaround 2 minutes after sending this email...
which consist in using the inv_adjacency_iterator_generator:
typedef typename boost::inv_adjacency_iterator_generator<Graph,
vertex_descriptor, in_edge_iterator>::type inv_adjacency_iterator;

Hope this will help someone else. Anyway, I would like to know why
this type can't be also part of boost::graph_traits?

-- 
Johan
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net