c++ Container print

template<typename Container>
void PrintContents(const Container& con)
{
  Container::const_iterator iter = con.begin();
  while (iter != con.end())
  {
    cout << *iter << endl;
    ++iter;
  }
  cout << endl;
}

posted @ 2019-06-10 14:40  西北逍遥  阅读(345)  评论(0编辑  收藏  举报