title: Exposing a private type with auto: where can it be useful?
body: <p>In this <a href="https://stackoverflow.com/q/13532784/771663">question </a> it was discussed why exposing a private type with <code>auto</code>:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class Base {
  
    class PrivateClass {    
    public: 
      void bar() { cout &lt;&lt; "PrivateClass" &lt;&lt; endl; }
    };
  
  public:
  
    PrivateClass foo() {
      PrivateClass a;
      return a;
    }
  
  };
  
  int main() {
  
    Base b;
    auto p = b.foo();
    p.bar();
    return 0;
  }
  </code></pre>
  
  <p>is perfectly fine by the C++11 standard. What I still don't get is how this idiom may be useful in a real application.
  <strong>Are there problems where this idiom can be effectively used, or it should be considered as a "curious" side-effect of the keyword?</strong></p>