The following code has errors:
cannot bind ‘std::basic_ostream’ lvalue to ‘std::basic_ostream&&
#include <boost/graph/graphviz.hpp>
void foo(int,char*[])
{
using namespace boost;
typedef boost::adjacency_list<
boost::setS, // outedge list
boost::setS, // vertex list
boost::directedS, // undirected
boost::no_property, // vertex prop
boost::no_property, // edge prop
boost::no_property, // graph prop
boost::setS // edgelistc
> Graph;
Graph g;
std::ostringstream dotname;
dotname << "a.dot";
std::ofstream dot(dotname.str());
write_graphviz(dot, g);
}
It works when boost::vecS, // vertex list
Is it expected?
Change the vertex container selector to
setS
changes the vertex descriptor into a type that is not streamable.You should, as with many many other algorithms in BGL, pass a separate vertex index:
External Vertex Id mapping
Live On Coliru
Prints e.g.
Internal property map:
You can put the property internally without much changing:
Live On Coliru