STL(4)adjacent_find函数
来源:互联网 发布:淘宝买的演唱会票真吗 编辑:程序博客网 时间:2024/04/28 16:51
/*// TEMPLATE FUNCTION adjacent_findtemplate<class _FwdIt> inline_FwdIt _Adjacent_find(_FwdIt _First, _FwdIt _Last){// find first matching successor_DEBUG_RANGE(_First, _Last);for (_FwdIt _Firstb; (_Firstb = _First) != _Last && ++_First != _Last; )if (*_Firstb == *_First)return (_Firstb);return (_Last);}template<class _FwdIt> inline_FwdIt adjacent_find(_FwdIt _First, _FwdIt _Last){// find first matching successor_ASSIGN_FROM_BASE(_First,_Adjacent_find(_CHECKED_BASE(_First), _CHECKED_BASE(_Last)));return (_First);}*///*********************by vincent http://my.csdn.net/sunboyiris ************************//#include "stdafx.h"#include "algorithm"#include "list"#include "iostream"using namespace std;bool fun(int x){return x%3?false:true;}int _tmain(int argc, _TCHAR* argv[]){list<int> l;for(int i=100;i<110;i++){l.push_back(i);} for(int i=109;i<116;i++){l.push_back(i);}//引用指针int count1=0;list<int>::iterator iter;for(iter=l.begin();iter!=l.end();iter++){ count1++;cout<<*iter<<endl;}cout<<count1<<endl;list<int>::iterator iter1=adjacent_find(l.begin(),l.end());if(iter1!=l.end()){cout<<"有相邻的元素相等"<<endl;cout<<"其元素为"<<*(iter1)<<" "<<*(++iter1)<<endl;}return 0;}
- STL(4)adjacent_find函数
- STL algorithm算法adjacent_find(4)
- 学习STL算法:adjacent_find
- STL之adjacent_find
- STL-adjacent_find算法
- STL泛型算法--adjacent_find()
- STL algorithm学习之adjacent_find()
- STL 之adjacent_find, merge,inplace_merge
- STL 之adjacent_find, merge,inplace_merge
- adjacent_find
- adjacent_find
- adjacent_find
- adjacent_find
- adjacent_find
- adjacent_find
- STL algorithm算法(01):adjacent_find
- C++的STL模板的adjacent_find()
- STL之for_each, find_if,adjacent_find,count_if的使用
- jquery遍历json
- 关注的计算机视觉研究组和个人主页列表
- 理解信息熵
- eval笔记
- 数据类型问题
- STL(4)adjacent_find函数
- rsync同步常用命令
- Tomcat version 6.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 Web modules
- 在listview中添加bitmap位图的方法
- 四大图像库:OpenCV/FreeImage/CImg/CxImage
- 简易解析ajax,javascript-XMLHttpRequest,解决乱码问题
- android binder理解
- History(历史)命令用法 15 例
- 移动互联网,政府服务怎么做?