我正在使用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;
}
答案 0 :(得分:0)
看起来你正试图在这里调用禁止的拷贝构造函数。
lemon::ListGraph()
的副本构造函数标记为private
,EdgeMap (const Graph &)
需要const Graph &
参数。
换句话说,ListGraph
和EdgeMap
的概念不匹配。据我所知,他们的文档ListGraph
提供了concepts::Digraph
概念,其中EdgeMap
需要符合ReferenceMap
的实施。