Lemon Graph Library C++ Map values as function arguments error

298 Views Asked by At

I am an absolute newbie with C++ and Lemon, and I have the following problem with lemon graph library. I would like to create a function, that gets a 'map' as an input variable. Something like this:

bool augment(Graph &g, Graph::EdgeMap<int> sol_edge)
   {
     //do something
   }

But when I try to build it, I get the following error:

\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|

Does it mean, that it is not possible to create a function with a map-type argument?

Thanks for any kind of help!

1

There are 1 best solutions below

0
On

You have to pass it by reference:

bool augment(ListGraph& g, ListGraph::EdgeMap<int>& sol_edge)    {
    //do something
}