私はこのコードを持っています:
#include <iostream>
#include <vector>
#include <list>
using namespace std;
class Graph {
public:
//Create graph with n nodes
Graph(int size);
~Graph();
//Initialize graph
void InitializeGraphWithRandomNum();
private:
vector <list <int*> > *graph;
};
void Graph::InitializeGraphWithRandomNum() {
//Here I want to iterate
for (int i=0; i< graph->size(); i++) {
std::list <int*>::iterator it;
for (it = graph[i].begin(); it< graph[i].end();++it) {
..........
}
}
}
ここで何かが間違っています。それは言う
'it = (((Graph*)this)->Graph::graph + ((unsigned int)(((unsigned int)i) * 12u)))->std::vector の 'operator=' に一致しません<_Tp, _Alloc>::begin with _Tp = std::list, _Alloc = std::allocator >, std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator*, std::vector > >, typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer = std::list*' DejkstraAlg.cpp
ありがとうベスト