title: C++ bitfield packing with bools
body: <p>I've just done a test with bitfields, and the results are surprising me. </p>
  
  <pre><code>class test1 {
  public:
      bool test_a:1;
      bool test_b:1;
      bool test_c:1;
      bool test_d:1;
      bool test_e:1;
      bool test_f:1;
      bool test_g:1;
      bool test_h:1;
  };
  
  class test2 {
  public:
      int test_a:1;
      int test_b:1;
      int test_c:1;
      int test_d:1;
      int test_e:1;
      int test_f:1;
      int test_g:1;
      int test_h:1;
  };
  
  class test3 {
  public:
      int test_a:1;
      bool test_b:1;
      int test_c:1;
      bool test_d:1;
      int test_e:1;
      bool test_f:1;
      int test_g:1;
      bool test_h:1;
  };
  </code></pre>
  
  <p>The results were:-</p>
  
  <pre><code>sizeof(test1) = 1   // This is what I'd expect. 8 bits in a byte
  sizeof(test2) = 4   // Reasonable. Maybe padded out to the size of an int.
  sizeof(test3) = 16  // What???
  </code></pre>
  
  <p>Is this what you'd expect, or a compiler bug? (Codegear C++ Builder 2007, btw...)</p>