把一个容器内容追加到另一个容器后面

1.vector  
  vector<string> vec_one;
  vector<string> vec_two;
  vec_one.push_back("xiaochun");
  vec_two.push_back("chunxiao");
  vec_two.insert(vec_two.end(),vec_one.begin(),vec_one.end());

 
2.map 
  map<int,string> m_one;
  map<int,string> m_two;
  m_one.insert(make_pair(1,"xiaochun"));
  m_two.insert(make_pair(2,"chunxiao"));
  m_two.insert(m_one.begin(),m_one.end());

  

 
posted @ 2017-09-11 10:21  那一剑的風情  阅读(450)  评论(0编辑  收藏  举报