I am trying to initialize a graph in boost. But I am getting an error I'm not able to understand.
typedef typename boost::adjacency_list
<
boost::vecS,
boost::vecS,
boost::directedS,
boost::no_property,
boost::property< boost::edge_weight_t, unsigned int >
> Graph;
Graph g;
std::ifstream fileIn(FILENAME);
if (fileIn.is_open()) {
std::vector<Edge> edgeVector;
std::vector<unsigned int> edgeWeightVector;
while (!fileIn.eof()) {
std::string line;
unsigned int sourceNode, destinationNode, edgeWeight;
std::getline(fileIn, line);
std::istringstream iss(line);
iss >> sourceNode;
while (iss >> destinationNode >> edgeWeight) {
edgeVector.push_back(Edge(sourceNode, destinationNode));
edgeWeightVector.push_back(edgeWeight);
}
std::cout << std::endl;
}
g = Graph(edgeVector.begin(), edgeVector.end(), edgeWeightVector, VERTEXNUMBER);
}
else {
std::cout << "Couldn't open file";
return 1;
}
The error I am getting is illegal indirection
and unary '++': 'EdgePropertyIterator' does not define this operator or a conversion to a type acceptable to the predefined operator
at Graph initialization line g = Graph(edgeVector.begin(), edgeVector.end(), edgeWeightVector, VERTEXNUMBER);
If I click on that error, it takes me to boost implementation at following lines
add_edge((*first).first, (*first).second, *ep_iter, static_cast<Graph&>(*this));
++first;
++ep_iter;