std count_if用法
2013-09-22 11:21
253 查看
#include <functional> #include <algorithm> nTotalCount= count_if(containerls.vPointers.begin(),containerls.vPointers.end(),bind2nd(compareuserinfoT(),deptmitm.ulDepartID)); nOnlineCount= count_if(containerls.vPointers.begin(),containerls.vPointers.end(),bind2nd(compareuserinfoO(),deptmitm.ulDepartID)); namespace std:: struct compareuserinfoT: binary_function<USERINFO*, unsigned long,bool> { bool operator()( USERINFO* &value, unsigned long uid) const { if (value->ulDepartID== uid) return true; else return false; } };
相关文章推荐
- C++函数对象count_if用法(转)
- count_if用法
- STL 计数(count,count_if)的用法
- 【C++STL】vector的count()和count_if()函数的用法
- std::find_if 用法
- if,while,std::cin,std::cout用法练习
- C++函数对象count_if用法(转)
- std::find_if 用法
- mysql sum(if())和count(if())的用法
- STL_ count,count_if用法
- ifndef/define/endif 和 #ifdef 、#if 作用和用法
- SQL中Count()用法
- <c:if test="value ne, eq, lt, gt,...."> 用法
- (转载)C++ using namespace std 用法深入解析
- extjs中apply和applyIf的用法
- std::find,std::find_if对类进行查找
- SQL语句---nvl、ifnull 用法(将null转代为0)
- sum/count的用法
- 4 流程控制(if的用法)
- dd命令用法中参数bs,count