求助:stl中 MAP怎么用copy以迭代的方式输出,代码已贴出,无法编译通过
程序代码:
#include <iostream>
#include <map>
#include <iterator>
using namespace std;
int main()
{
typedef map<int,string> map_test;
typedef pair<int,string> pair_test;
typedef ostream_iterator <pair> ostream_itr;
map_test te1;
pair_test p1(1,"ti");
for(int i=0;i<5;i++)
te1.insert(p1);
copy(te1.begin(),te1.end(),ostream_itr(cout,"\n"));
return 0;
}
求大神帮忙




