title: "taking address of temporary" warning
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8324699/taking-address-of-temporary-while-accessing-address-of-a-element-in-vectorbool">taking address of temporary while accessing address of a element in vector&lt;bool&gt;</a>  </p>
  </blockquote>
  
  
  
  <p>I get 'taking address of temporary' warning at line 7 in following piece of code<br/>  </p>
  
  <pre><code>vector&lt;bool&gt; boolVect;
  bool x = true;
  boolVect.push_back(true);
  boolVect.push_back(false);
  ofstream fMetaOut("tmp.txt", ios::out);
  fMetaOut.write((char* )&amp;x, sizeof(bool));
  fMetaOut.write((char* )&amp;boolVect[0], sizeof(bool));
  fMetaOut.close();
  </code></pre>
  
  <p>Why do I get this warning at line 7 and not at 6 ??
  Both use boolean address. <br/>
  How can I get rid of this warning?</p>