class MyVisitor : public boost::default_dfs_visitor {
public:
MyVisitor() : vv(new std::vector<DotVertex>()) {}
void discover_vertex(DotVertex v, const graph_t& g) { //note the lack of const
//if (boost::in_degree(v, g) != 0) { //only print the vertices in the connected component (I already did MCC and removed edges so all the extra vertices are isolated)
std::cerr << v.label << std::endl;
vv->push_back(v);
//}
return;
}
std::vector<DotVertex>& GetVector() const { return *vv; }
private:
boost::shared_ptr< std::vector<DotVertex> > vv;
};
Я написал вышеупомянутый посетитель для DFS в boost. Я получил следующую ошибку:
ошибка C2664: 'void MyVisitor :: explore_vertex (DotVertex, const graph_t &)': невозможно преобразовать аргумент 1 из «unsigned int» в «DotVertex»
Как я могу решить эту проблему?