0

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

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by n.utiu
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.