#include <iostream>
#include <map>
using namespace std;
#include <iterator>
int main ()
{
typedef map<int, char, less<int> > M;
M m1;
m1.insert(M::value_type(2,'B'));
m1.insert(M::value_type(3,'C'));
m1.insert(M::value_type(1,'A'));
M::iterator It = m1.begin();
cout << endl << "m1:" << endl;
while ( It != m1.end() )
{
cout << (*It).first << " - "
<< (*It).second
<< endl;
It++;
}
// copy constructor
M m2(m1);
It = m2.begin();
cout << endl << "m2:" << endl;
while ( It != m2.end() )
{
cout << (*It).first << " - "
<< (*It).second
<< endl;
It++;
}
M m3(m2.begin(),m2.end());
It = m3.begin();
cout << endl << "m3:" << endl;
while ( It != m3.end() )
{
cout << (*It).first << " - "
<< (*It).second
<< endl;
It++;
}
getchar();
return 0;
}