Boost logo

Boost :

Subject: Re: [boost] Boost::Graph --- why does this program not compile?
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-01-28 18:38:10

> template <class Graph>
> inline Graph orthogonality_relation() {
> typedef std::pair<unsigned int, unsigned int> edge_type;
> std::vector<edge_type> ev;
> Graph g(ev.begin(), ev.end(), 0, 0);
> return g;
> }
> typedef boost::adjacency_list<boost::listS, boost::vecS,
> boost::undirectedS> UndirectedGraph;

Its probably a collaboration of problems between the pair<unsigned,
unsigned> and the listS in the adjacency list. It looks like the graph is
expecting a vertex descriptor to be a pointer (hence the unary *), but it's
getting an unsigned (which can't be dereferenced). Try changing listS to
vecS and see if that fixes the problem.

Andrew Sutton

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