¿C ++ 11 std :: function limita el número de argumentos que puede tener un puntero de función?
Estoy usando la versión beta de Visual Studio 11 y tengo curiosidad por un error de compilación. Estoy almacenando un objeto std :: function en mi clase.
<code>typedef std::function<void (int, const char*, int, int, const char*)> MyCallback; </code>
En mi clase tengo
<code>MyCallback m_callback; </code>
Esto compila muy bien. Si agrego un argumento más a la lista, falla.
<code>typedef std::function<void (int, const char*, int, int, const char*, int)> MyCallback; </code>
El fallo es:
<code>>c:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(535): error C2027: use of undefined type 'std::_Get_function_impl<_Tx>' 1> with 1> [ 1> _Tx=void (int,const char *,int,int,const char *,int) 1> ] 1> f:\development\projects\applications\my.h(72) : see reference to class template instantiation 'std::function<_Fty>' being compiled 1> with 1> [ 1> _Fty=void (int,const char *,int,int,const char *,int) 1> ] 1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(536): error C2504: 'type' : base class undefined 1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(539): error C2027: use of undefined type 'std::_Get_function_impl<_Tx>' 1> with 1> [ 1> _Tx=void (int,const char *,int,int,const char *,int) 1> ] 1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\functional(539): error C2146: syntax error : missing ';' before identifier '_Mybase' 1>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>
Esta es una biblioteca enlazada dinámicamente que está preparando datos para pasar a otra aplicación. Ciertamente puedo volver a trabajar el formato de los datos para que puedan pasar con menos argumentos, pero me preguntaba por qué veo este límite.
Volviendo al puntero de función de estilo c,
<code> typedef void (*MyCallback)(int, const char*, int, int, const char*, int); </code>
parece funcionar bien