Since k_valid_keys
is static
declared at Validator
, all the derived classes from Validator
will share the same instance of k_valid_keys
. That's it, you will not be able to have more than one instance of a subclass of Validator
at the same time in your program, else your different instances of subclases of Validator
will add elements to the same structure.
That's is, a static member variable on a class is just a global variable of your entire program.
If you have two or more subclases of Validator
but you guarantee that you are going to have only just one instance, you just initialize k_valid_keys
on the subclass constructor.