Boost logo

Boost Users :

From: Tony Juricic (tonygeek_at_[hidden])
Date: 2005-01-17 22:31:18

Has anybody created custom dijkstra_shortest_paths algorithm visitor for
discover_vertex event?

I am having all sorts of compilation errors using MSVC 7.1 and defining
my visitor using example code.

Reshuffling the code (but at this point I hardly know what am I really
doing) I got the following to compile:

// define visitor for discover_vertex event

template <class Vertex, class Tag>
struct target_visitor
   : public default_dijkstra_visitor
   target_visitor(Vertex u) : v(u) { }

   template <class Vertex, class Graph>
   void discover_vertex(Vertex u, Graph& g)
      if ( u==v )

   Vertex v;

template <class Vertex, class Tag>
target_visitor<Vertex, Tag>
target_visit(Vertex u, Tag) {
   return target_visitor<Vertex, Tag>(u);

// call dijkstra_shortest_paths with custom visitor
// parameters below are defined as in dijkstra-example.cpp

  dijkstra_shortest_paths(g, s,


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at