title: Member variable alias in class template specialization
body: <p>Let's suppose I'm writing a <code>Vector</code> template class to represent points and vectors in an N-dimensional space. Something like the following:</p>
  
  <pre><code>template &lt;typename T, int N&gt;
  struct Vector
  {
      T data[N];
      // ...
  };
  </code></pre>
  
  <p>Let's further assume that, for whatever reason, I want the user to be able to access <code>data</code> with meaningful names in the case of smaller vectors, e.g. by using <code>v.x</code>or <code>v.y</code> instead of <code>v.data[0]</code> and <code>v.data[1]</code>.</p>
  
  <p>I have two additional constraints.</p>
  
  <ol>
  <li>Access to the <code>x</code> or <code>y</code> component of a vector should not be written as a function call (e.g. it should be <code>v.x</code>, not <code>v.x()</code>).</li>
  <li>The following equality must hold <code>sizeof(Vector&lt;T, N&gt;) == N * sizeof(T)</code>.</li>
  </ol>
  
  <p>I looked at different possible approaches, including member variable references, <em>tag dispatch</em> and even <em>CRTP</em> but none of them satisfied all of my requirements.</p>
  
  <p>Is it even possible to create such aliases? And if yes, how could one do it?</p>