title: How to prevent implicit conversion from char array to bool
body: <pre><code>struct Foo {
    void setBar(bool bar_) { bar = bar_; }
    bool bar;
  };
  
  int main() {
    Foo f;
    f.setBar("true");
  }
  </code></pre>
  
  <p>The above code compiles successfully due to type conversion, even though a char array is passed where a <code>bool</code> is expected.</p>
  
  <p>Is it possible to cause this code to fail compilation? (C++03 solution preferred, since the compiler at my workplace is ancient.)</p>
  
  <p>I have looked at the following related questions on StackOverflow, but they don't quite address this problem. <a href="https://stackoverflow.com/questions/18455755/preventing-implicit-conversion-in-c">Preventing implicit conversion in C++</a>, <a href="https://stackoverflow.com/questions/316181/why-does-the-compiler-choose-bool-over-string-for-implicit-typecast-of-l">Why does the compiler choose bool over string for implicit typecast of L&quot;&quot;?</a></p>