title: Referring to a class defined inside a function scope
body: <p>In C++1y, it is possible for a function's return type to involve locally defined types:</p>
  
  <pre><code>auto foo(void) {
    class C {};
    return C();
  }
  </code></pre>
  
  <p>The class name <code>C</code> is not in scope outside the body of <code>foo</code>, so you can create class instances but not specify their type:</p>
  
  <pre><code>auto x            = foo(); // Type not given explicitly
  decltype(foo()) y = foo(); // Provides no more information than 'auto'
  </code></pre>
  
  <p>Sometimes it is desirable to specify a type explicitly.  That is, it is useful to write "the type C that is defined in foo" instead of "whatever type foo returns."  Is there a way to write the type of <code>foo</code>'s return value explicitly?</p>