vector of bools not initialized correctly
<p>I have initialized a <code>vector</code> of <code>bools</code>, but for some reason 
everything is set to <code>false</code>. Why can I not set a <code>vector</code> of
<code>bool</code> to <code>true</code>?</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;

int main()
{
  std::vector&lt;bool&gt; d_WFlag;
  int d_numGrids = 4;
  d_WFlag.resize(d_numGrids);

  d_WFlag[0] = false;
  std::cout &lt;&lt; std::noboolalpha &lt;&lt; d_WFlag[0] &lt;&lt; " == " &lt;&lt; std::boolalpha &lt;&lt; d_WFlag[0] &lt;&lt; std::endl;
  for(int i = 1; i &lt; (d_numGrids - 1); ++i)
  {
    d_WFlag.push_back(true);
    std::cout &lt;&lt; std::noboolalpha &lt;&lt; d_WFlag[i] &lt;&lt; " == " &lt;&lt; std::boolalpha &lt;&lt; d_WFlag[i] &lt;&lt; std::endl;
  }
  d_WFlag[d_numGrids - 1] = false;
  std::cout &lt;&lt; std::noboolalpha &lt;&lt; d_WFlag[d_numGrids - 1] &lt;&lt; " == " &lt;&lt; std::boolalpha &lt;&lt; d_WFlag[d_numGrids - 1] &lt;&lt; std::endl;

  return 0;
}
</code></pre>
