quiere pasar boost :: bind a un método que espera un puntero de función simple (misma firma).demote boost :: function a un puntero de función simple
typedef void TriggerProc_type(Variable*,void*);
void InitVariable(TriggerProc_type *proc);
boost::function<void (Variable*, void*)> triggerProc ...
InitVariable(triggerProc);
error C2664: 'InitVariable' : cannot convert parameter 1 from
'boost::function<Signature>' to 'void (__cdecl *)(type *,void *)'
puedo evitar el almacenamiento de un impulso :: función y sólo tiene que pasar el funtor unido directamente, pero luego me sale error similar:
error C2664: 'blah(void (__cdecl *)(type *,void *))' : cannot convert parameter
1 from 'boost::_bi::bind_t<R,F,L>' to 'void (__cdecl *)(type *,void *)'
'boost :: function pfn = static_cast > (userData); '¿debería usar boost :: function * en su lugar o habrá error de compilación? –
Gohan
@Gohan sí, esa fue la intención del autor. Arreglaré la publicación ... – Yann