My program has a enum to store colors
and user response
like this. Now I need to keep RGB
and CYMK
values along with the color. So this cannot do using enum,
enum COLOR
{
RED = 'R',
GREEN = 'G',
BLUE = 'B',
YELLOW = 'Y',
MAGENTA = 'M'
};
So I' planing to use static array of struct for this purpose. I use static because
- These values are never change in the program
To avoid multiple creation of the vector when other classes creating and destroying this classes object.
struct Color { char user_responce; std::string rgb_code; std::string cymk_code; }; static std::vector<Color> colors; colors.push_back('R', "FF0000", "30 - 96 - 76 - 26");
But after reading this post Is using a lot of static methods a bad thing? I feel bad about the way I'm doing. Is this a "unsafe" statics? any other suggestion?