title: Anonymous union and struct
body: <p>How would you go about doing this in standard C++11/14 ? Because if I'm not mistaken this isn't standard compliant code with the anonymous structs.</p>
  
  <p>I wish to access the members the same way as you would with this.</p>
  
  <pre><code>template &lt;typename some_type&gt;
  struct vec
  {
      union {
          struct { some_type x, y, z; };
          struct { some_type r, g, b; };
  
          some_type elements[3];
      };
  };
  </code></pre>