Very simple question about best practices and performance. I know that it's a bad idea to use bare constants in your code directly (e.g. -1 meaning "unassigned"). I generally don't like using the preprocessor for such things if I can help it, since I don't like shouting (e.g. #define UNASSIGNED -1) and don't like breaking with the convention of putting preprocessor names in all caps. So I've taken to using anonymous enums:
enum { Unassigned = -1 }; Question: Is there any runtime performance penalty for this compared to the preprocessor approach? Is this a bad idea?
constvariables? I'm not suggesting it, just questioning.