Boost logo

Boost :

Subject: [boost] [BGL] on using visitor in dijkstra_shortest_path
From: Sandeep Gupta (gupta.sandeep_at_[hidden])
Date: 2009-07-01 19:22:59

 The example code for extending dijkstra via gives compilation errors.
Attached below is the snippet code and the error messages using gcc-4.3.3
and boost_138_0.

typedef boost::adjacency_list<vecS, vecS, bidirectionalS > graphImpl_t;

//----taken for doc---
template <class PredecessorMap>
class record_predecessors : public dijkstra_visitor<>
  record_predecessors(PredecessorMap p)
      : m_predecessor(p) { }

    template <class Edge, class Graph>
    void edge_relaxed(Edge e, Graph& g) {
      // set the parent of the target(e) to source(e)
      put(m_predecessor, target(e, g), source(e, g));
    PredecessorMap m_predecessor;

template <class PredecessorMap>
record_predecessors<PredecessorMap> //error: expected constructor,
destructor, or type conversion before ‘<’ token
  make_predecessor_recorder(PredecessorMap p) {
    return record_predecessors<PredecessorMap>(p);
///---end doc--------------
 vector<vertex_t> p(num_vertices(gg));
  dijkstra_shortest_paths(gg, src,

Thanks in advance.

Boost list run by bdawes at, gregod at, cpdaniel at, john at