title: 8 bool vs 1 int
body: <p>A <code>bool</code> takes 1 byte in C++. But, why does a <code>bool[8]</code> take 8 bytes instead of 1 byte?
  One byte has enough space for 8 bits.</p>
  
  <p>I compiled this with GCC using <code>-Os</code> flag:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class Foo
  {
      public:
          bool m_bool[8];
  };
  
  int main ()
  {
      cout &lt;&lt; "Size: " &lt;&lt; sizeof(Foo) &lt;&lt; " byte(s) " &lt;&lt; endl;
  
     return 0;
  }
  </code></pre>
  
  <p>It returns "Size: 8 byte(s)".</p>
  
  <p>Is there a way to optimize it?</p>