C ++ 11 std :: function limita o número de argumentos que um ponteiro de função pode ter?
Eu estou usando o Visual Studio 11 beta e estou curioso sobre um erro de compilação eu estou ficando armazenar um objeto std :: function na minha classe.
<code>typedef std::function<void (int, const char*, int, int, const char*)> MyCallback; </code>
Na minha aula eu tenho
<code>MyCallback m_callback; </code>
Isso compila muito bem. Se eu adicionar mais um argumento à lista, ele falhará.
<code>typedef std::function<void (int, const char*, int, int, const char*, int)> MyCallback; </code>
A falha é:
<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 é uma biblioteca vinculada dinamicamente que está preparando dados para passar para outro aplicativo. Eu certamente posso retrabalhar o formato dos dados para que possam ser passados com menos argumentos, mas fiquei me perguntando por que vejo esse limite?
Voltando ao ponteiro de função do estilo c,
<code> typedef void (*MyCallback)(int, const char*, int, int, const char*, int); </code>
parece funcionar bem.