This is why I asked the question, instead of just doing it.
I won't do this.
But let me toss this out, in case it changes anyones mind...
Geoff the Medio wrote:
That's something to avoid, as it would mean that any change to that file or any of its contents would force recompilation of everything that includes it. Enums.h does basically what you're proposing for the general-use enumerations, and often has that issue.
But that is actually an argument for doing the change I am suggesting.
Consider something like UniverseObject.h, which has INVALID_POSITION and SINCE_BEFORE_TIME_AGE.
That file has had 8 commits over the last year.
Suppose those constants were moved to Enums.h.
Enums.h only had 3 commits over the last year.
Doesn't have to be in Enums.h, it was just a convenient file to pick.
(Maybe something like Export.h, which defines FO_COMMON_API, and has only changed once in 4 years.)
I could always create a new header, which has a just handful of frequently used (but never altered?) default constants. That file would change much less frequently than whatever header files currently have those constants.
As far as ALL_EMPIRES goes, the way it is used is more confusing for new programmers than it has to be.
ALL_EMPIRES is declared in 8 header files (including Empire.h), but it is defined on line 71 of Universe.cpp. Besides being buried in a non-obvious place, it is not declared in the Universe.h file. (It is declared in the UniverseObject.h file, which is included in the Universe.h file, which again is not helping the readability.)
Has its value ever deviated from -1? Or expected to, for some reason?
(I would think it would be simpler to stuff its definition into a header file.)