Insert a pair of object into a map
<p>I'm trying to insert some pair value into a map. May map is composed by an object and a vector of another object. i don't know why but the only way to make the code to compile is to declare the first object like a pointer. But in this way when I insert some object, only the first pair is put into the map.</p>

<p>My map is this: </p>

<pre><code>map&lt;prmEdge,vector&lt;prmNode&gt; &gt; archi;
</code></pre>

<p>this is the code:</p>

<p>{</p>

<pre><code>bool prmPlanner::insert_edge(int from,int to,int h) {

prmEdge e; 
int f=from; 
int t=to; 
if(to&lt;from){
    f=to;
    t=from; 
} 

e.setFrom(f);
e.setTo(t);

vector&lt;prmNode&gt; app;

prmNode par=nodes[e.getFrom()]; 
prmNode arr=nodes[e.getTo()];

app.push_back(par);
app.push_back(arr);

archi.insert(pair&lt;prmEdge,vector&lt;prmNode&gt; &gt;(e,app) );

return true;
 }
</code></pre>

<p>}</p>

<p>In this way, I have an error in compilation in the class pair.h.
What could I do?? Thank you very much.</p>
