class StuFun
{
           int num;
public:
           void set(int _num)
           {
                      num = _num;
           }
           bool operator()(Stu *stu)
           {
                      return num= stu->GetNum();
           }
}


//1
void main()
{
           Stu *s = new Stu(6,"홍길동");
           StuFun sf;
           sf.GetNum(6);

           if(sf(s))
}


//2
typedef vector<Stu*>::Iterator SIter
void main()
{
           vector<Stu*> *mv = new vector<Stu*>;
           mv->push_back(3,"홍길동");
           mv->push_back(5,"황태주");
           mv->push_back(6,"정기성");

           StuFun sf;
           sf.set(5);

           SIter seek = find_if(mv->begin(),mv->end(),sf);
}

 

template <typename Iter, typename F>
Iter find_if(Iter beg,Iter end, F fun)
{
           for(;beg!=end;++beg)
           {
                      if(fun(*beg))
                      {
                       break;
                      }
           }
           return end;
}