1. 程式人生 > >stl(四)------如何對map進行賦值std::map::operator=

stl(四)------如何對map進行賦值std::map::operator=

      /* using namespace std;
map <int, int>::iterator m1_pIter, m2_pIter;


map <int, int> m1, m2;
typedef pair <int, int> Int_Pair;


m1.insert ( Int_Pair ( 1, 10 ) );
m1.insert ( Int_Pair ( 2, 20 ) );
m1.insert ( Int_Pair ( 3, 30 ) );
m1.insert ( Int_Pair ( 4, 40 ) );
m2 = m1;