C++模板与STL库演示幻灯片.pptVIP

  • 6
  • 0
  • 约1.36万字
  • 约 92页
  • 2018-02-23 发布于天津
  • 举报
p = find(v.begin(),v.end(),9); if( p == v.end()) cout not found endl; p = find(v.begin()+1,v.end()-2,1); if( p != v.end()) cout * p endl; int * pp = find( array,array+4,20); cout * pp endl; } 输出: 3 not found 3 20 顺序容器(vector deque list )的算法 除前述共同操作外,顺序容器还有以下共同操作: front() :返回容器中第一个元素的引用 back() : 返回容器中最后一个元素的引用 push_back(): 在容器末尾增加新元素 pop_back(): 删除容器末尾的元素 比如,查 list::front 的help,得到的定义是: reference front(); const_reference front() const; list有两个front函数 顺序容器的引用 reference 和 const_reference 是typedef的类型 对于 listdouble , listdouble::reference 实际上就是 double listdouble::const_

文档评论(0)

1亿VIP精品文档

相关文档