title: Statically initialize anonymous union in C++
body: <p>I am trying to statically initialize the following structure in Visual Studio 2010:</p>
  
  <pre><code>struct Data
  {
     int x;
     union
     {
        const Data* data;
        struct {int x; int y; };
     };
  };
  </code></pre>
  
  <p>The following is fails with <code>error C2440: 'initializing' : cannot convert from 'Data *' to 'char'</code>.</p>
  
  <pre><code>static Data d1;
  static Data d = {1, &amp;d1};
  static Data d2 = {1, {1, 2}};
  </code></pre>
  
  <p>I have found references to some ways this can be initialized properly but none of them work in VS2010. Any ideas?</p>