M
mrstephengross
I'm using gcc 3.3.1 to compile the following code (below). I've written
a macro to simplify writing operators. The macro uses the '##' operator
to paste together 'operator' and the name of the operator (ie: '+').
gcc reports that pasting the two things together "does not give a valid
preprocessing token". Here's the code:
====================
#define OPER(op) operator ## op
class thing
{
public:
bool OPER(==) (const thing & other) const { return true; }
};
int main() { return 0; }
=============================
The error reads: (line 7): pasting "operator" and "==" does not give a
valid preprocessing token
Any ideas?
Thanks,
--Steve ([email protected])
a macro to simplify writing operators. The macro uses the '##' operator
to paste together 'operator' and the name of the operator (ie: '+').
gcc reports that pasting the two things together "does not give a valid
preprocessing token". Here's the code:
====================
#define OPER(op) operator ## op
class thing
{
public:
bool OPER(==) (const thing & other) const { return true; }
};
int main() { return 0; }
=============================
The error reads: (line 7): pasting "operator" and "==" does not give a
valid preprocessing token
Any ideas?
Thanks,
--Steve ([email protected])