jeudi 6 avril 2017

Vector with pointers to Different methods

I want to collect pointers to different methods in my vector (properly map):

std::map < sf::Keyboard::Key, std::function<void()> > keyData;

and now, when i want to add something to this vector, i have got problem.

    inputManager.addKeyToCheck(sf::Keyboard::A, std::bind(&mv::Scene::moveViewLeft, mv::Scene::getInstance()));

because there i get this error:

Error C2665 'std::tuple::tuple': none of the 2 overloads could convert all the argument types

I need to storage pointers to methods of different classes and i don't know how i get do it. Any other solutions or ideas how can i repair this code?

Aucun commentaire:

Enregistrer un commentaire