123456789101112131415161718192021222324252627
void Map::breadthFirstTraversal(Nodes t){ for(int i = 0 ; i< cityMap.size(); i++) { visited[i] = 0; } queue <int> q; q.push(t); while(!q.empty()) { int s = q.front(); q.pop(); visited[s] = 1; cout<<s<<endl; for(int i = 0; i<=q.size(); i++) { if(visited[i] == 0) { q.push(i); visited[i] = 1; } } } }
no matching function for call to ‘std::queue<int, std::deque<int, std::allocator<int> > >::push(Nodes&)’
12345
struct Noce { int data; string stuff; };
int s = q.front()->data;