我是C++和Lemon的新手,我对lemon图形库有以下问题。我想创建一个函数,它得到一个'map‘作为输入变量。如下所示:
bool augment(Graph &g, Graph::EdgeMap<int> sol_edge)
{
//do something
}但是当我尝试构建它时,我得到了以下错误:
\lemon-1.3\lemon\bits\vector_map.h|110|error: 'lemon::VectorMap<_Graph, _Item, _Value>::VectorMap(const lemon::VectorMap<_Graph, _Item, _Value>&) [with _Graph = lemon::GraphExtender<lemon::ListGraphBase>; _Item = lemon::ListGraphBase::Node; _Value = bool; lemon::VectorMap<_Graph, _Item, _Value> = lemon::VectorMap<lemon::GraphExtender<lemon::ListGraphBase>, lemon::ListGraphBase::Node, bool>]' is private|这是否意味着不能使用map类型的参数创建函数?
感谢您的任何帮助!
发布于 2014-06-25 22:44:38
您必须通过引用传递它:
bool augment(ListGraph& g, ListGraph::EdgeMap<int>& sol_edge) {
//do something
}https://stackoverflow.com/questions/20435409
复制相似问题