Where to put global domain specific constants (and how)?
<p>I have a C++ code that's a physics simulation tool. </p>

<p>I would like to store some physical constants, conversion factor between different sets of units, and also some more application specific constants (such as definition like <code>enum Planes {X=0, Y=1}</code>) and I would like to be able to access them from everywhere in my code.</p>

<p>What would be the best way to do that ?</p>

<p>I think one way would be to create a namespace <code>namespace constants</code> (which can then be a nested namespace in my main namespace) with nested namespaces (like 'constants', 'units', etc.).</p>

<p>Would it be the way you would do that ?</p>

<p>If I use that method, do I have to make it a header file and include it everywhere ? </p>

<p>If I understand correctly the variables in the namespace at global scope have <code>static</code> linkage, but no <code>external</code> linkage. Then if I want to use them without including a file, I also have to declare them <code>extern</code> ?</p>

<p>As you can see I am a bit confused about that...</p>
