$ make -f makefile.txt
g++ -Wall -W -Werror -pedantic -g -c MinPriority.cpp
MinPriority.cpp: In member function `void MinPriority::createArray()':
MinPriority.cpp:50: error: expected primary-expression before '&' token
MinPriority.cpp:50: error: expected primary-expression before ',' token
MinPriority.cpp:50: error: expected primary-expression before "targetVertex"
makefile.txt:7: recipe for target `MinPriority.o' failed
make: *** [MinPriority.o] Error 1
Basically I am trying to access a function of Graph.h (located in private:) who's purpose is to pass by reference a vector of the linked list at a given index. Basically it looks at a vector of linked lists, goes to a certain index of the vector and turns its linked list into a vector and passes it by reference to a function in another file. Here is where the error occurs.
void Graph::get_adjLine(vector<Edge>& v, string targetVertex) //passes back a node and its adjacencies in the form of a vector
{
//vector<Edge> v;
int index;
for(unsigned int i = 0; i != adjList.size(); i++) //find the targetVertex's index
{
if(adjList[i].front().m_vertex == targetVertex)
{
index = i;
continue;
}
}
copy(adjList[index].begin(), adjList[index].end(), v.begin());
}
I am currently trying to find any possible way to pass the private structure of vector< list<Edge> > adjList; into MinPriority::createArray(). Any way would be best for me, but i spent the last few hours trying to come up with a way to do it, but I can't figure it out. Here are the class declarations: Graph.h