您当前的位置: 首页 >  c++

程序员正茂

暂无认证

  • 4浏览

    0关注

    283博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

C++ 自定义仿函数删除元素

程序员正茂 发布时间:2018-07-22 16:44:06 ,浏览量:4

struct EqualCvRect : public binary_function
{
public:

	bool operator()(const CvRect& rect1, const CvRect& rect2) const
	{
		if (rect1.x == rect2.x && rect1.y == rect2.y &&
			rect1.width == rect2.width && rect1.height == rect2.height)
		{
			return true;
		}
		return false;
	}
};

CvRect rect(10, 10, 35, 35);
listRect.erase(remove_if(listRect.begin(), listRect.end(), bind2nd(EqualCvRect(), rect)), listRect.end());

 

关注
打赏
1660743125
查看更多评论
立即登录/注册

微信扫码登录

0.1221s