undef class

Hi,
I have found this statement in a .hpp file just before declaring
class DLLEXPORT newClass {
....
}
What is the reason for #undef class?
Thanks
It sounds to me like somewhere previously in the header, or in an included header, there must be a #define for the symbol class. Obviously, that will crap all over the C++ keyword class, so it needs to be #undef'ed.
Thanks, that's it. I thought that class reserved keyword but I understand it can also be an ordinary string symbol.
It is a reserved keyword. But remember that preprocessor definitions are a purely textual find-and-replace operation, that happens before the compiler runs. So it doesn't matter that it's a reserved keyword; the preprocessor will overwrite it anyway.
Very clear, thanks again!
Topic archived. No new replies allowed.