我需要知道两个指向 STL 映射的指针之间的区别
例如:使用矢量很简单
vector<pair<int, int> > v;
v.push_back(make_pair(0, 1));
v.push_back(make_pair(2, 3));
v.push_back(make_pair(4, 5));
v.push_back(make_pair(6, 7));
v.push_back(make_pair(8, 9));
vector<pair<int, int> >::iterator itrBegin = v.begin();
vector<pair<int, int> >::iterator itrEnd = v.end();
cout << itrEnd - itrBegin << endl;
输出5
但是,我想使用 STL map 执行相同的操作
map<int, int> m;
m[0] = 1;
m[2] = 3;
m[4] = 5;
m[6] = 7;
m[8] = 9;
map<int, int>::iterator itrB = m.begin();
map<int, int>::iterator itrE = m.end();
cout << ????????????? << endl;