c++ - Boost C++ 库中的深度优先搜索未显示错误
问题描述
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;
};
我在 boost 中为 DFS 编写了上述访问者。我收到以下错误:
错误 C2664: 'void MyVisitor::discover_vertex(DotVertex,const graph_t &)': 无法将参数 1 从 'unsigned int' 转换为 'DotVertex'
我怎么解决这个问题?
解决方案
推荐阅读
- python - 如何从构成体素化体积中的一条线的 3D 点列表中获取体素数组?
- java - 在spring-boot应用程序中自动装配组件时如何解决NullPointerException
- java - 游戏在功能强大的设备上速度较慢。我正在使用三角洲
- java - 如何清理 thymeleaf 模板的 json 输出?
- python - 如何使正则表达式仅匹配整个单词而不分解单词?
- python - 使用请求发送到其他 API 时,上传到 Flask 的文件为空
- symfony - 控制器能够搜索名字和姓氏
- laravel - laravel 表单不断重定向到同一页面
- java - 为什么我无法使用 JavaMail(IMAP 协议)连接到我的邮箱并出现 NO AUTHENTICATE failed 错误?
- spring - 使用空字符串作为属性的默认值,以便它可以与其他字符串连接形成一个值