1

I am using the Lemon graph library.

I want to assign integer weights to the edges. Thus I am using EdgeMap. Unfortunality my code doesn't compile.

no matching function for call to 'lemon::concepts::Graph::EdgeMap<int>::EdgeMap(lemon::ListGraph&)'

Any ideas?

#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;
}
rici
  • 234,347
  • 28
  • 237
  • 341

1 Answers1

0

Looks like you're trying to call a forbidden copy constructor here. The copy constructor of lemon::ListGraph() is marked as private and EdgeMap (const Graph &) wants a const Graph & parameter.

In other words, the concepts for ListGraph and EdgeMap don't match. As far as I understood from their documentation ListGraph provides the concepts::Digraph concept, where EdgeMap requires a ReferenceMap compliant implementation.

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190