|
Boost Users : |
Subject: Re: [Boost-users] Adjacency List vertex access
From: Cosimo Calabrese (cosimo.calabrese_at_[hidden])
Date: 2011-05-04 16:40:29
Well, I'm working with Boost 1.46.1, Visual Studio 2010, and I detect an
error like yours.
I don't understand why you need an iterator that point to a vertex. If
you need it, I presume that you want to dereference it, obtaining the
correspondent vertex_descriptor. The particular implementation of
adjacency_list that you have choosed (vecS, vecS) implements a
vertex_descriptor that corresponds to the index of the vertex. If you
take a look at the definition of boost::vertex function you can see it:
template <class Graph, class Config, class Base>
inline typename Config::vertex_descriptor
vertex(typename Config::vertices_size_type n,
const vec_adj_list_impl<Graph, Config, Base>&)
{
return n;
}
So, if you want to take the vertex_iterator that point to the N-th
vertex, and you dereference it, you obtain simply N.
Regards,
Cosimo Calabrese
Il 04/05/2011 22.19, Caro Jardinier ha scritto:
> OK with version 1.42 (1.42.0-4 0 from Debian Wheezy) this works, but I get
> the Warning:
>
> g++ test.cpp
> In file included from /usr/include/c++/4.3/backward/hash_set:64,
> from /usr/include/boost/pending/container_traits.hpp:23,
> from /usr/include/boost/graph/detail/adjacency_list.hpp:31,
> from /usr/include/boost/graph/adjacency_list.hpp:324,
> from test.cpp:1:
> /usr/include/c++/4.3/backward/backward_warning.h:33:2: warning: #warning
> This file includes at least one deprecated or antiquated header which may be
> removed without further notice at a future date. Please use a non-deprecated
> interface with equivalent functionality instead. For a listing of
> replacement headers and interfaces, consult the file backward_warning.h. To
> disable this warning use -Wno-deprecated.
>
>
> --
> View this message in context: http://boost.2283326.n4.nabble.com/Adjacency-List-vertex-access-tp3495589p3496694.html
> Sent from the Boost - Users mailing list archive at Nabble.com.
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