After solving this simple issue, I had to ask :
-> In the H file in a class ex a const static member is defined, e.g. :
class ex {
const static int m
This is a historical thing.
Since C, static
on a definition means "internal linkage". When C++ came along, and classes were added to it, Bjarne needed a keyword to signify static members. Not wanting to add new keywords (a preference that largely exists still to this day), he re-used static
instead.
Now static
meant two different things depending on where you put it. So you can't write static
here because it would mean something else. Thus, the language doesn't require you to, as that would be silly.
Beyond that reasoning, it just is. When you create a language, you balance simplicity of specification against simplicity of implementation against simplicity of use, and you come up with a set of rules that are the language. At some point you have to stop quibbling over "why" some insignificant rule was created and just get on with writing your program.