title: Why does direct list initialization causes ambiguity for type reference cast if cast operators to the type and reference to the type are declared?
body: <p>The question rose in context of <a href="https://stackoverflow.com/a/41076678/4324224">this answer</a>.</p>
  
  <p>Consider an example:</p>
  
  <pre><code>struct foo {
      int value;
      operator int&amp;(){ return value; }
      operator int(){ return value; }
  };
  
  int main () {
      int &amp;a(foo{}); // #1
      //int &amp;b{foo{}}; // #2 -- ambiguity
      int &amp;c = foo{}; // #3
      //int &amp;d = {foo{}}; // #4-- ambiguity
      int &amp;d { a }; // #5
      int &amp;e = { a }; // #6
      (void)a;
      (void)c;
      (void)d;
      (void)e;
  }
  </code></pre>
  
  <p>I don't understand why does #2 and #4 cause ambiguity while #1 and #3 does not. So the question is - why does direct list initialization causes ambiguity for implicit cast to reference if cast operators to the type and reference to the type are declared?</p>