class biggerThan
{
public:
const int testValue;
biggerThan(int x) : testValue(x) { }
bool operator()(int val) const
{ return val > testValue; }
};
现在说其使用像
std::list<int>::iterator firstBig =
std::find_if(aList.begin(), aList.end(), biggerThan(12));
OR
只需在这样 biggerThan对象(12)
现在,当大(12)这个被使用时,它可以调用constrcuto r初始化testvalue或()运算符被重载,12被传递给函数(bool operator()(int val)const),以便返回一个bool。
哪一个先出现/它是如何工作的
做它会导致任何歧义或做呼叫转移到overlaode操作发生在一些时尚像
object.operator()。(12) 。
请让我的支持清楚。
[...](http://example.com)什么? – 2011-05-25 08:28:37