C++谓词一元谓词概念
概念:
返回bool类型的仿函数称为谓词如果operator()接受一个参数,那么叫做一元谓词如果operator()接受两个参数,那么叫做二元谓词
#include <iostream>
#include <functional>
using namespace std
;
void test01()
{
negate
<int> n
;
cout
<< n(50) << endl
;
}
void test02()
{
plus
<int> p
;
cout
<< p(10, 20) << endl
;
}
int main()
{
test01();
test02();
return 0;
}
C++谓词一元谓词概念
转载请注明原文地址:https://tech.qufami.com/read-28726.html