我使用的是Lemon图形库。
我想要将整数权重分配给边。因此我使用的是EdgeMap。不幸的是我的代码不能编译。
no matching function for call to 'lemon::concepts::Graph::EdgeMap<int>::EdgeMap(lemon::ListGraph&)'有什么想法吗?
#include <lemon/list_graph.h>
#include <lemon/concepts/graph.h>
#include <iostream>
using namespace lemon;
using namespace std;
int main(int argc, const char * argv[])
{
ListGraph g;
lemon::concepts::Graph::EdgeMap<int> map(g);
return 0;
}发布于 2014-06-30 03:59:01
看起来你正在尝试调用一个被禁止的复制构造函数。lemon::ListGraph()的复制构造函数被标记为private,而EdgeMap (const Graph &)需要一个const Graph &参数。
换句话说,ListGraph和EdgeMap的概念不匹配。据我从他们的文档中了解,ListGraph提供了concepts::Digraph概念,而EdgeMap需要ReferenceMap兼容的实现。
https://stackoverflow.com/questions/24479559
复制相似问题