// Define basic groups for plugins' configuration.
static const int cgCompiler = 0x01; ///< Compiler related.
static const int cgDebugger = 0x02; ///< Debugger related.
static const int cgEditor = 0x04; ///< Editor related.
static const int cgCorePlugin = 0x08; ///< One of the core plugins.
static const int cgContribPlugin = 0x10; ///< One of the contrib plugins (or any third-party plugin for that matter).
static const int cgUnknown = 0x20; ///< Unknown. This will be probably grouped with cgContribPlugin.
They are defined as const. So a "copy" is the same constant value.Yes. But...Anyway, I do believe variable definitions in header file is not a good idea.
Yes. But...Anyway, I do believe variable definitions in header file is not a good idea.static const can be seen as the c++ style of a #define. In the case you refer to it's also similar to an enum, so this is OK.
Morten: do you know the reason why this is not an enum, but a number of static variables?Usually this is because if you compare the values against another one which is an INT, too you don't need to take care to cast the values to avoid compiler warnings. At least that's when I personally prefer static const instead of an enum.
Usually this is because if you compare the values against another one which is an INT, too you don't need to take care to cast the values to avoid compiler warnings.I guess that if it was defined as a enum, then the user/client will define same enum type variables too, some kind of type consistent. :)
I guess that if it was defined as a enum, then the user/client will define same enum type variables too, some kind of type consistent. :)I thought more in a direction to compare it against a value of a control or alike. There, you have no choice other than INT or SIZE_T or alike.