I have the following code, but does not compile:
Expand|Select|Wrap|Line Numbers
- #include <iostream>
- using namespace std;
- template<class Arg, class Result>
- struct unary_function
- {
- typedef Arg argument_type;
- typedef Result result_type;
- };
- class Greater: public unary_function<int, bool>
- {
- public:
- result_type operator () (argument_type k)
- {
- if (k>10)
- return true;
- else
- return false;
- }
- };
expected template-name before '<' token
expected `{' before '<' token
expected unqualified-id before '<' token
All of these errors are related to the line:
class Greater: public unary_function<int, bool>
I would appreciate any insights. Thank you.