Errors when using map() in C++
<p>I wrote a piece of code and used map and vector but it shows me something I can't get. I'll be thankful if someone help me in this way and correct my code or give me some hints.</p>

<p>The code is:</p>

<pre><code>      // For each node in N, calculate the reachability, i.e., the
      // number of nodes in N2 which are not yet covered by at
      // least one node in the MPR set, and which are reachable
      // through this 1-hop neighbor
      std::map&lt;int, std::vector&lt;const NeighborTuple *&gt; &gt; reachability;
      std::set&lt;int&gt; rs;
      for (NeighborSet::iterator it = N.begin(); it != N.end(); it++)
        {
          NeighborTuple const &amp;nb_tuple = *it;
          int r = 0;
          for (TwoHopNeighborSet::iterator it2 = N2.begin (); it2 != N2.end (); it2++)
            {
              TwoHopNeighborTuple const &amp;nb2hop_tuple = *it2;
              if (nb_tuple.neighborMainAddr == nb2hop_tuple.neighborMainAddr)
                r++;
            }
          rs.insert (r);
          reachability[r].push_back (&amp;nb_tuple);
        }
/*******************************************************************************/
//for keepping exposition of a node
        std::map&lt;Vector, std::vector&lt;const NeighborTuple *&gt; &gt; position; 
        std::set&lt;Vector&gt; pos; 
        for (NeighborSet::iterator it = N.begin(); it != N.end(); it++)
        {
          NeighborTuple   nb_tuple = *it;

          Vector exposition;
          pos.insert (exposition);
          position[exposition].push_back (&amp;nb_tuple);
        } 
</code></pre>

<p>and the errors are for this line: <code>position[exposition].push_back (&amp;nb_tuple);</code>
and the errors are:</p>

<pre><code>/usr/include/c++/4.1.2/bits/stl_function.h: In member function ‘bool std::less&lt;_
Tp&gt;::operator()(const _Tp&amp;, const _Tp&amp;) const [with _Tp = ns3::Vector3D]’:
/usr/include/c++/4.1.2/bits/stl_map.h:347:   instantiated from ‘_Tp&amp; std::map&lt;_K
ey, _Tp, _Compare, _Alloc&gt;::operator[](const _Key&amp;) [with _Key = ns3::Vector3D, _Tp = std::vector&lt;const ns3::olsr::NeighborTuple*, std::allocator&lt;const ns3::olsr::NeighborTuple*&gt; &gt;, _Compare = std::less&lt;ns3::Vector3D&gt;, _Alloc = std::allocator&lt;std::pair&lt;const ns3::Vector3D, std::vector&lt;const ns3::olsr::NeighborTuple*, std::allocator&lt;const ns3::olsr::NeighborTuple*&gt; &gt; &gt; &gt;]’
../src/routing/olsr/olsr-routing-protocol.cc:853:   instantiated from here
/usr/include/c++/4.1.2/bits/stl_function.h:227: error: no match for ‘operator&lt;’ in ‘__x &lt; __y’
debug/ns3/ipv6-address.h:432: note: candidates are: bool ns3::operator&lt;(const ns3::Ipv6Address&amp;, const ns3::Ipv6Address&amp;)
debug/ns3/nstime.h:475: note:                 bool ns3::operator&lt;(const ns3::Time&amp;, const ns3::Time&amp;)
debug/ns3/ipv4-address.h:305: note:                 bool ns3::operator&lt;(const ns3::Ipv4Address&amp;, const ns3::Ipv4Address&amp;)
debug/ns3/address.h:231: note:                 bool ns3::operator&lt;(const ns3::Address&amp;, const ns3::Address&amp;)
debug/ns3/type-id.h:376: note:                 bool ns3::operator&lt;(ns3::TypeId, ns3::TypeId)
</code></pre>

<p>Thanks in advance.
Bahar</p>
