map a float value to key which is a pair
<p>I am trying to create a map and map a float value to key which is of type pair. I am not able display the map using the display function.    </p>

<pre><code>#include &lt;iostream&gt;
#include &lt;utility&gt;
#include &lt;iomanip&gt;
#include &lt;map&gt;

using namespace std;
typedef pair&lt;int, int&gt; Key; //pair

void display (map &lt;Key,float&gt; &amp;m) // to print maps
{
    cout &lt;&lt; "\tTotal size: " &lt;&lt; m.size() &lt;&lt; endl; 
    map &lt;Key,float&gt;::iterator it;
    for (it = m.begin(); it != m.end(); ++it)
       cout &lt;&lt; setw(10) &lt;&lt; it-&gt;first &lt;&lt; setw(5) &lt;&lt; it-&gt;second &lt;&lt; endl;

    cout &lt;&lt; endl; 
}

int main() {

map&lt; Key , float&gt; mapa; //create map

Key p1 (1, 45); //key values
Key p2 (2, 20);

mapa[p1]= 25.11; //map float to keys
mapa[p2]= 11.23;

display(mapa); //display map

return 0;

}
</code></pre>
