title: C++, does bool conversion always fall back to implicit conversion to void*?
body: <p><strong>Question:</strong> Does implicit bool conversions always fall back to attempting implicit conversion to <code>void*</code>? (If such a conversion function exists for the type). If so, why?</p>
  
  <p>Consider the following short program:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  class Foo{
  public:
  
      operator void*() const
      {
          std::cout &lt;&lt; "operator void*() const" &lt;&lt; std::endl;
          return 0;
      }
  };
  
  int main()
  {
      Foo f;
  
      if(f)
          std::cout &lt;&lt; "True" &lt;&lt; std::endl;
      else
          std::cout &lt;&lt; "False" &lt;&lt; std::endl;
  
      return 0;
  }
  </code></pre>
  
  <p>The output of this program is:</p>
  
  <pre><code>operator void*() const
  False
  </code></pre>
  
  <p>meaning, the conversion function to <code>void*</code> was called.
  If we tag an <code>explicit</code> qualifier in front of the conversion function then the implicit conversion to <code>void*</code> would fail.</p>
  
  <p><strong>Edit:</strong>
  It seems many answers are that "null pointers can be converted to <code>false</code>". I understand this, my question was regarding the "if I can't directly call <code>operator bool()</code> then I will try conversion to any pointer".</p>