<div dir="ltr"><div>Would firstly like to thank the developper(s) of the lemon graph library for this great library. I've been using it for a little while now... and I think I've got the basics. There are some things unclear to me though... and it's centred mostly around allocation (in memory).Consider the following code-snippet:<br><br>    lemon::ListDigraph dg1;<br>    lemon::ListDigraph::Node n1 = dg1.addNode ( );<br><br>    lemon::ListDigraph* dg2 ( new lemon::ListDigraph );<br>    lemon::ListDigraph::Node n2 = dg2->addNode ( );<br>    lemon::ListDigraph::Node* n3 = &dg2->addNode ( );  // warning: address of temp taken! obviously the wrong thing to do.<br><br>Where are n1 and n2, respectively allocated (stack and heap?)... and what are they, pointers, references or objects? Somewhere in the user-list-archives there's a post asking about constructing large graphs, with an advice to use the heap (case 2) and std::vector for (automatic) memory management... When using dg2, does everything that is attached to it (f.e. NodeMap) end up on the heap?<br></div><div><br>When doing:<br><br>    lemon::ListDigraph::Node n1 = n2;<br><br></div><div>has anything happened to either graph? Is n1 now a copy of n2, or is it now n2?<br><br></div><div>Sorry for my ignorance. Thanks in advance for any enlightenment offered!<br></div></div>