함수객체를 이용하여 구조체에 특별한 값을 검색하는데 std::find를 이용하고 싶습니다.
예)
typedef struct _ITEM
{
int id;
string name;
} ITEM;
typedef vector<ITEM> ITEM_VEC;
ITEM_VEC v;
class _finder
{
public:
_finder(int _id):id(_id) {}
bool operator () (const ITEM& itm) const
{
return (itm.id == id);
}
private:
const int id;