function object 有什么用处?
比如下面这个类中
class LessThan
{
public:
LessThan(int val):_val(val){} ;
int get_val(){ return _val ; } ;
void set_val(int val){ _val = val ; } ;
bool operator()( int value ) const ; //function Object
private:
int _val ;
} ;
inline bool LessThan::operator()(int value) const
{
return value < _val ;
}
该怎么使用这个函数对象?