title: Initializing union of structs nicely
body: <p>I'm coding a Vec3 class, and for optimization purpose, I make it with no constructor.
  I also would like to be able to access its members as x, y, z OR as r, g, b OR as a tab.
  Easy, you might think : use a union</p>
  
  <pre><code>template &lt;typename T&gt; struct Vec3_t    
  {    
      union    
      {
          T val[3];    
          struct { T x, y, z; };    
          struct { T r, g, b; };    
      };
  };
  </code></pre>
  
  <p>Then, since I have no ctor, I would like to initialize it like this :</p>
  
  <pre><code>Vec3_t&lt;int&gt; v = {1, 2, 3};
  </code></pre>
  
  <p>but I have to put double braces since I'm initializing a struct in a struct (like this : <code>Vec3_t&lt;int&gt; v = {{1, 2, 3}}</code> )</p>
  
  <p><strong>So, my question is</strong> : How could I do it so that I can have both access with different names, and initialization with one pair of braces ?</p>
  
  <p>my try : having one union for each component, but then exit with the access as a table (one can always call &amp;v.x and treat it as a float[3], but that's kind of dirty... and not so safe I guess)</p>