Home > Back-end >  Use c binary_function structure//why can't find the <operator?
Use c binary_function structure//why can't find the <operator?

Time:10-11

 
The class Student
{
Public:
Student (void);
~ Student (void);
Public:
Float _stuScore;
//a Boolean operator overloading
Boolean operator & lt; (const Student& Stu)
{
Return _stuScore & lt; Stu. _stuScore;
}
};


Struct CharLess: public binary_function & lt; Const Student, const Student, bool>
{
Public:
Result_type operator () (const first_argument_type & amp; _Left, const second_argument_type & amp; Const _Right)
{
Return _Left & lt; _Right;
}
};

Hash_map & lt; Const char *, int, hash_compare & lt; Const Student, CharLess> CharHash;
  • Related