title: Why is my "explicit operator bool()" not called?
body: <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  struct A
  {
      explicit operator bool() const
      {
          return true;
      }
  
      operator int()
      {
          return 0;
      }
  };
  
  int main()
  {
      if (A())
      {
          cout &lt;&lt; "true" &lt;&lt; endl;
      }
      else
      {
          cout &lt;&lt; "false" &lt;&lt; endl;
      }
  }
  </code></pre>
  
  <p>My expectation was that <code>A()</code> would be contextually converted to <code>bool</code> using my <code>operator bool()</code>, and therefore print <code>true</code>.</p>
  
  <p>However, the output is <code>false</code>, showing that <code>operator int()</code> was invoked instead.</p>
  
  <p>Why is my <code>explicit operator bool</code> not called as expected?</p>