您的位置:首页 > 其它

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;
}
};
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: