title: Compile-time map and inverse map values
body: <p>Can someone recommend a more elegant way to achieve these compile-time constants?</p>
  
  <pre><code>template &lt;int&gt; struct Map;
  template &lt;&gt; struct Map&lt;0&gt; {static const int value = 4;};
  template &lt;&gt; struct Map&lt;1&gt; {static const int value = 8;};
  template &lt;&gt; struct Map&lt;2&gt; {static const int value = 15;};
  
  template &lt;int&gt; struct MapInverse;
  template &lt;&gt; struct MapInverse&lt;4&gt; {static const int value = 0;};
  template &lt;&gt; struct MapInverse&lt;8&gt; {static const int value = 1;};
  template &lt;&gt; struct MapInverse&lt;15&gt; {static const int value = 2;};
  </code></pre>
  
  <p>The values need to be constexpr in my program, yet the inverse mapped values are getting tedious to update (and easy to make mistakes or forget to do even).</p>