title: Does C++11 std::function limit the number of arguments a function pointer can have?
body: <p>I'm using the Visual Studio 11 beta and I'm curious about a compilation error i'm getting storing a std::function object in my class. </p>
  
  <pre><code>typedef std::function&lt;void (int, const char*, int, int, const char*)&gt; MyCallback;
  </code></pre>
  
  <p>In my class I have,</p>
  
  <pre><code>MyCallback m_callback;
  </code></pre>
  
  <p>This compiles just fine. If I add one more argument to the list it fails.</p>
  
  <pre><code>typedef std::function&lt;void (int, const char*, int, int, const char*, int)&gt; MyCallback;
  </code></pre>
  
  <p>The failure is:</p>
  
  <pre><code>&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(535): error C2027: use of undefined type 'std::_Get_function_impl&lt;_Tx&gt;'
  1&gt;          with
  1&gt;          [
  1&gt;              _Tx=void (int,const char *,int,int,const char *,int)
  1&gt;          ]
  1&gt;          f:\development\projects\applications\my.h(72) : see reference to class template instantiation 'std::function&lt;_Fty&gt;' being compiled
  1&gt;          with
  1&gt;          [
  1&gt;              _Fty=void (int,const char *,int,int,const char *,int)
  1&gt;          ]
  1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(536): error C2504: 'type' : base class undefined
  1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(539): error C2027: use of undefined type 'std::_Get_function_impl&lt;_Tx&gt;'
  1&gt;          with
  1&gt;          [
  1&gt;              _Tx=void (int,const char *,int,int,const char *,int)
  1&gt;          ]
  1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(539): error C2146: syntax error : missing ';' before identifier '_Mybase'
  1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(539): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  </code></pre>
  
  <p>This is a dynamically linked library which is preparing data to pass to another application. I can certainly rework the format of the data so that it can be passed with fewer arguments, but I was wondering why I see this limit?</p>
  
  <p>Switching back to the c-style function pointer,</p>
  
  <pre><code> typedef void (*MyCallback)(int, const char*, int, int, const char*, int);
  </code></pre>
  
  <p>seems to work fine.</p>