title: Multiple names for the same variable in C++
body: <p>Is it possible in C++ to refer to the same variable using different names without using the preprocessor?</p>
  
  <p>To achieve the same effect as this pseudocode</p>
  
  <pre><code>struct vec3f {
      float[3] values;
  };
  
  struct color : public vec3f {
      #define r values[0]
      #define g values[1]
      #define b values[2]
  };
  
  color c;
  c.r = 0.5f;
  </code></pre>
  
  <p>The following has the right semantics except it allocates space in the struct for the 3 references:</p>
  
  <pre><code>struct color : public vec3f {
      float&amp; r;
      float&amp; g;
      float&amp; b;
      color() : r(values[0]), g(values[1]), b(values[2]) { }
  };
  </code></pre>
  
  <p>Is there a way to get this compile-time name substitution without increasing the size of the struct?</p>