title: C++ anonymous structs?
body: <p>A previous post of mine raised the topic of anonymous structs, with several commentators saying these were not allowed in C++.</p>
  <p>Here is a construction that I use a lot: is this legal C++?</p>
  <pre><code>const int HeaderSize = 8192;
  struct Header
  {
      union
      {
          struct
          {
              int r;
              // other members
          };
          unsigned char unused[HeaderSize]; // makes Header struct's size remain constant as members are added to the inner struct
      };
      // Default constructor
      Header()
      {
  
      }
  };
  </code></pre>