title: Does auto changes internal types visibility in C++?
body: <p>I have this simple code:</p>
  
  <pre><code>#include &lt;vector&gt;
  
  class A
  {
      private:
          struct B{int x;};
      public:
          std::vector&lt;B&gt; v;
  };
  
  int main()
  {
      A a;
  
      for (std::vector&lt;A::B&gt;::iterator it = a.v.begin(); it != a.v.end(); ++it)
      {
          it-&gt;x = 0;
      }
      for (auto it = a.v.begin(); it != a.v.end(); ++it)
      {
          it-&gt;x = 0;
      }
  }
  </code></pre>
  
  <p>As expected I have build error in the first for loop - A::B is private, but second for loop compiles fine in Visual Studio 2010, 2012 and 2013. Is this normal behavior or it's a bug in the compiler?</p>