title: Automatic conversion from double/int/string to bool in C++
body: <p>I'm a Java programmer who has been trying to learn a bit of C++ on the side to expand on my knowledge. Here is a small code snippet which I <em>think</em> works due to implicit conversion but I'd like to know which part of the specification does it refer to and what are the other rules which I must be aware of when it comes to implicit conversion. Is there a document/link/site out there which lays down the implicit conversion rules?</p>
  
  <pre><code>#include &lt;vector&gt;
  #include &lt;iostream&gt;
  #include &lt;iterator&gt;
  
  int main(void) {
    using namespace std;
    vector&lt;bool&gt; a;
    a.push_back("asdf");
    a.push_back("");  
    a.push_back(12);  
    a.push_back(0.0);  
    copy(a.begin(), a.end(), ostream_iterator&lt;bool&gt;(cout, "\n"));
    return 0;
  }
  
  /*
  output:
  
  1
  1
  1
  0
  */
  </code></pre>
  
  <p>TIA,<br>
  sasuke</p>