I have a requirement when a variable (const) must be available in all cpp consisting of several classes. I decided to use a namespace to solve the problem, but am not sure of the following:
- Is it necessary to define this variable as static?
- Is it true that I can avoid turning the variable static only if I go over with an unnamed namespace?
source share