title: Why can't I implicitly construct an object given a suitable constructor when passing to an argument?
body: <p>In the below example, why can't I simply pass a <code>string</code> to the <code>printFoo()</code>?</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  class Foo {
  public:
    Foo(const Foo &amp;foo) : str(foo.str) {}
    Foo(string str) : str(str) {}
  
    string str;
  };
  
  void printFoo(Foo foo) {
    cout &lt;&lt; foo.str &lt;&lt; endl;
  }
  
  int main() {
    Foo foo("qux");
    printFoo(foo); // OK
  
    printFoo("qix"); // error: no matching function for call to 'printFoo'
  
    return 0;
  }
  </code></pre>
  
  <p>For whatever reason, I had in my head that a constructor would automatically be determined and used in order to construct an object.</p>
  
  <p>Why can't I do this, but I can pass a <code>char[n]</code> constant to an argument accepting a <code>std::string</code>, for example?</p>