<div dir="ltr"><div>Hi! I want to add an item to a lemon map without copying it or asigning. Here is the code:<br></div><div><br></div>#include <iostream><br>#include <lemon/list_graph.h><br>#include <lemon/maps.h><br>
<br>using namespace lemon;<br>using namespace std;<br><br>typedef lemon::ListDigraph             LGraph;<br>typedef lemon::ListDigraph::Arc        LArc;<br>typedef lemon::ListDigraph::Node       LNode;<br><br>class MyNode {<br>
    public:<br>            CrossRefMap<LGraph, LArc, std::string> inputs;<br><br>            MyNode(const LGraph& graph) : inputs(graph) { }<br>};<br><br><br>int main(){<br>            LGraph graph;<br>            LGraph::NodeMap<MyNode> nodes(graph);<br>
<br>            LNode n = graph.addNode();<br>            nodes[n] = MyNode(graph); // error: object of type 'MyNode' cannot be assigned because its  copy assignment operator is implicitly deleted<br><br>            return 0;<br>
}<br><br>The main problem here is the CrossRefMap which needs initialization in constructor and has has no copy consturctor or assignment operator. I could use pointer to this structure instead, but this solution doesn't satisfy me. How can I solve this problem? Any suggestions will be appreciated. ;)<div>
<br></div><div>Regards<br></div></div>