$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] BGL:  Vertex or Vertex& ?
From: Roger House (rhouse_at_[hidden])
Date: 2009-01-29 20:21:15
I've just started using the Boost Graph Library (which is proving to be a
very nice tool) and I've encountered an issue:  When vertex descriptors
are passed as parameters, stored in vectors, etc., is it better to use
Vertex&, or is Vertex alone okay.  I've been assuming that a vertex
descriptor is probably a pointer, so I've been using Vertex.  But then is
occurred to me that my assumption could be all wrong and I should be
using Vertex&.  Here are the Graph, Vertex, and Edge definitions I've
been using:
typedef adjacency_list
<
    vecS,       // edge container type
    vecS,       // vertex container type
    undirectedS,
    VertexProperties,
    EdgeProperties,
    GraphProperties
 > Graph;
typedef graph_traits<Graph>::vertex_descriptor  Vertex;
typedef graph_traits<Graph>::edge_descriptor    Edge;
Roger House