title: auto type deduction with container of pointers
body: <p>I don't understand why the compiler decided on pointer to in for the iterator itr in the 3rd for loop, instead of a pointer to a pointer as in the first 2 loops.  I tried to parse <a href="http://en.cppreference.com/w/cpp/language/template_argument_deduction" rel="nofollow noreferrer" title="the deduction rules">the deduction rules </a>but couldn't find the relevant section.</p>
  
  <pre><code>void foo()
  {
      vector&lt;int*&gt; a;
      int b[] =   { 1, 2, 3 };
  
      for (int i = 0; i &lt; 3; i++)
      {
          a.push_back(&amp;b[i]);
      }
      for (vector&lt;int*&gt;::iterator itr = a.begin(); itr != a.end(); ++itr)
      {
          //itr is a pointer to a pointer to an int
          cout &lt;&lt; **itr &lt;&lt; endl;
      }
      for (auto itr = a.begin(); itr != a.end(); ++itr)
      {
          //itr is a pointer to a pointer to an int
          cout &lt;&lt; **itr &lt;&lt; endl;
      }
      for (auto itr : a)
      {
          //itr is a pointer to an int.  Why?
          cout &lt;&lt; *itr &lt;&lt; endl;
      }
  }
  </code></pre>