Could there be something between the keyword "class" and the class name in C ++?
2 answers
If you've seen this in Windows code, it's probably a macro that determines whether you want to export or import a given class.
This is very common if you are dealing with dll-s.
So this macro is probably something like this:
#ifdef PROJECTNAME_EXPORTS
#define MACROBEFORECLASSNAME __declspec(dllexport)
#else
#define MACROBEFORECLASSNAME __declspec(dllimport)
#endif
If you compile the dll, the preprocessor definition PROJECTNAME_EXPORTS must be defined, so the compiler will export this class. If you compile a project that only uses this DLL, then ... EXPORTS will not be defined, so the compiler will import this class.
+4
source to share