Subject: Re: [boost] Boost::Graph --- why does this program not compile?
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-01-30 07:56:30
> However, changing
> Graph g(ev.begin(), ev.end(), 0, 0);
> Graph g(ev.begin(), ev.end(), 0);
> makes it compile (which is not a possibility in my case, since
> I need the optional argument).
It looks like the wrong constructor was instantiated. It looks like that
first 0 is being substituted as an EdgePropertyIterator instead of the
number of vertices, which I'm guessing is what you really want to do. If
you're trying to set that last 0 as the number of edges, you don't *really*
need that parameter. The constructor doesn't actually use it. It doesn't
even give the parameter a name. The reason is that the iterator range
defines the number of vertices.
So, from what I can tell (assuming that I'm reading your intent correctly),
the change that works will actually fix your problem. The other way to fix
it might be:
Graph g(ev.begin(), ev.end(), 0, 0, Graph::graph_property_type());
Again though, that last 0 doesn't do anything.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk