title: Defining global constants in C++1z?
body: <p>What is the best way of declaring memory efficient <em>Global Constants</em> in <strong><em>C++1z</em></strong> which do not make <em><a href="https://stackoverflow.com/questions/1358400/what-is-external-linkage-and-internal-linkage">internal linkage</a></em>, so a single copy is used though out all the <em><a href="https://stackoverflow.com/questions/1106149/what-is-a-translation-unit-in-c">translation units</a></em>?</p>
  
  <p>Although it's been mentioned in many places, we didn't have any singular "The best approach" question and answer, so here it is. Here is a partial list of places where I have found related questions.</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/34445336/constexpr-global-constants-in-a-header-file-and-odr">constexpr global constants in a header file and odr</a></li>
  <li><a href="https://stackoverflow.com/questions/31129919/global-declarations-initializations-using-static-const-constexpr">global declarations/initializations using static, const, constexpr</a></li>
  <li><a href="https://stackoverflow.com/questions/23655406/global-constants-in-c11">Global Constants in C++11</a></li>
  <li><a href="https://stackoverflow.com/questions/2268749/defining-global-constant-in-c">Defining global constant in C++</a></li>
  <li><a href="https://stackoverflow.com/questions/1517881/c-global-constants-issue">c++ global constants issue</a></li>
  <li><a href="https://stackoverflow.com/questions/1515552/global-constants-vs-enumeration">Global Constants vs. Enumeration</a></li>
  <li><a href="https://stackoverflow.com/questions/3189545/proper-way-to-make-a-global-constant-in-c">Proper way to make a global “constant” in C++</a></li>
  </ul>
  
  <p>I am looking for a solution for atleast all basic basic types, like <code>int</code>, <code>double</code>, <code>char</code>, <code>std::string</code>.</p>
  
  <p><strong>Edit 1:</strong>
  By best way, I mean <em>"memory efficient"</em>. I know for internal linkage, multiple copies for each translation unit will be made, hence eating memory. Along with that if we can achieve fast execution time and compile time, that will be great, glamorizing (easiness of ) the code doesn't matter. Also I know external linkage will increase the fetching time because the processor may get cache misses at run time. But does latest C++ language support the best approach for all these ? Or may be suggested support for each case ?</p>
  
  <p><strong>Note:</strong> Also what will be best approach for <code>std::string</code> global constants ? Does there <em>mutability</em> will have any affect on there <em>constness</em> ?</p>