I have been recently experimenting with functors and tried o make my own one, inheriting from unary_operator, but I get some errors.
template <typename T, int intN = 0>
class cIsBad : public unary_function <T, bool> {
public:
bool operator() (const T& tParameter) const {
return tParameter == intN;
}
};
I get these errors:
|2|error: expected template-name before ‘<’ token|
|2|error: expected ‘{’ before ‘<’ token|
|2|error: expected unqualified-id before ‘<’ token|
|8|warning: extra ‘;’|
P.S. I compile with gcc