Boost logo

Boost Users :

From: Val Samko (boost_at_[hidden])
Date: 2004-04-04 10:39:48


Why doesn't the following code compile (VC++ 7.1, g++ 3.3.3, boost 1.31.0) ?
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/johnson_all_pairs_shortest.hpp>
int main()
        using namespace boost;
        typedef adjacency_list<vecS, vecS, bidirectionalS,
                                                        boost::property<boost::vertex_index_t, int,
                                                        boost::property<boost::edge_weight_t, int> >
> Graph;
        Graph g;
        int distance_matrix[100][100];
        johnson_all_pairs_shortest_paths(g, distance_matrix);
but it compiles, if we pass the edge weight map (composed from
std::map<edge_descriptor, int>) as a named parameter to
johnson_all_pairs_shortest_paths ?

Also, why do
johnson_all_pairs_shortest_paths(g, distance_matrix);
johnson_all_pairs_shortest_paths(g, distance_matrix, weight_map(get(vertex_index, g)));
produce completely different compile time errors?

Finally, is it possible to use
with adjacency_list<mapS, mapS, ...> ?
According to the documentation, this should be possible, but this
just does not compile.

 Val Samko                

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