0

I want to create a custom map to assign different weights to different arcs.

struct MyMap{
            typedef int Value;
            typedef ListDigraph::Arc Key;
            unordered_map<Key, Value> mapping;
            Value operator[](const Key& e) {return mapping.at(e);}
        };

But I get an error in the mapping search, saying:

In template: type 'const std::hash<lemon::ListDigraphBase::Arc>' does not provide a call operator

I cannot use the standard maps of LEMON, since I cannot pass them between functions and I cannot have them as attribute of class.

How can I do it ?

  • The error message means that you must define a hash function for your `unordered_map`. See duplicate for details. – john Jun 19 '23 at 14:34

0 Answers0