V
vsgdp
Why derive from: binary_function? It seems like that class just does some
typedefs.
For example, in Stroustrup (pg. 517 3rd edition):
class Club_eq : public unary_function<Club, bool> {
string s;
public:
explicit Club_eq(const string& ss) : s(ss) {}
bool operator()(const Club& c) const { return c.name == s; }
};
He still uses "Club" and "bool" instead of the typdefed argument_type and
result_type. So what is the point of these base classes?
typedefs.
For example, in Stroustrup (pg. 517 3rd edition):
class Club_eq : public unary_function<Club, bool> {
string s;
public:
explicit Club_eq(const string& ss) : s(ss) {}
bool operator()(const Club& c) const { return c.name == s; }
};
He still uses "Club" and "bool" instead of the typdefed argument_type and
result_type. So what is the point of these base classes?