Boost logo

Boost :

Subject: [boost] Boost::Graph --- why does this program not compile?
From: Oliver Kullmann (O.Kullmann_at_[hidden])
Date: 2009-01-28 16:08:56


Hello,

in parallel to trying to get 1_34_1 compiling again,
I'll also try to understand why the code won't compile
with 1_37_0.

Now I found the following program which actually compiles
neither with 1_34_1 nor with 1_37_0, but it should:

-------------------

#include <utility>
#include <vector>

#include <boost/graph/adjacency_list.hpp>

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;

int main () {
  orthogonality_relation<UndirectedGraph>();
}

-------------------

The abbreviated error-message from gcc (version 4.1.2) is:

Error.cpp:17: instantiated from here
Boost/1_37_0+4.1.2/include/boost-1_37_0/boost/graph/detail/adjacency_list.hpp:2113: error: invalid type argument of ‘unary *’

where line 17 is the last line of the main-function.

Oliver


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk