title: Local classes : C++03 vs. C++11
body: <p>Is there any change in the usage of local class in C++11?</p>
  
  <p>It seems in C++03 local classes cannot be used as template argument (I recall that).</p>
  
  <p>Consider this code,</p>
  
  <pre><code>template&lt;typename T&gt; void f(const T&amp;) {}
  
  //Note : S is a local class defined inside main()
  int main() { struct S{};  f(S()); } //I want template argument to be deduced.
  </code></pre>
  
  <p>But it gives compilation error (C++03 mode), saying (<a href="http://ideone.com/6nB1U">ideone</a>):</p>
  
  <blockquote>
    <p>prog.cpp:4: error: no matching function for call to ‘f(main()::S)’</p>
  </blockquote>
  
  <p>However, it compiles fine when compiling it in C++11 mode (<a href="http://ideone.com/oNkWE">ideone</a>), which makes sense to me, otherwise lambda wouldn't work. So I guess that there is at least this change in the usage of local classes. Am I right? What are other changes concerning local classes?</p>
  
  <p>Please quote the relevant text from the Standards (C++03 and C++11 both) so readers can compare themselves, and for future reference.</p>